Tag: How to

How to redirect a page using jQuery ?

If you want to redirect a page , one of the best option is to use the window.location.replace method that can demonstrate the HTTP redirect instead of any jQuery trick. How to redirect a page using jQuery ? Below is a sample code snippet demonstrating the redirection of a page .

How to Generate Unique ID in C# ?

Do you want to generate a unique id in C# ? . You can use Guid to generate unique data or ID. Below is a sample code snippet that demonstrates how to generate unique ID in C# . How to Generate Unique ID in C# ?

How to Get the Application’s path in Windows or Console Application in C#?

There are times when you want to retrieve the application’s path where the exe is running to get access to another file or accessing the configuration file etc. Below is a sample program that demonstrates how one can retrieve the Application’s path in Windows or Console Application in C#. How to Get the Application’s path in Windows or Console Application in C#?

Single Click Preview in Visual Studio 2013 Solution Explorer

The single click preview is one of the cool feature in Visual Studio 2013 which lets the developers preview the file in the preview tab. This feature is available for use from Visual Studio Solution explorer as well. You can activate it by clicking the Preview Selected Items button in the Solution explorer toolbar. To disable this feature , you can click the same button…

How to Get the Address based on the Co-Ordinates in Windows Phone 8 ?

Below is a sample code snippet that demonstrates how to get the address of the location based on the co-ordinates in Windows Phone 8. How to Get the Address based on the Co-Ordinates in Windows Phone 8 ? In the below code snippet , the latitude and longitude is fixed . The Google’s API is used to get the location details by passing it to…

How to delete user account from command line in Windows 10 ?

You can delete a user account from command line in Windows 10 using the net user command and specifying the delete parameters. How to delete user account from command line in Windows 10 ? The syntax for deleting the user from the command line is as follows. net user <username> /DELETE The above command deletes the user from the local system. For example , if…

How to Programatically Create ApplicationBar in Windows Phone ?

Are you looking to create ApplicationBar programmatically at runtime in Windows Phone ? . Below is a sample code snippet that demonstrates how to create Application Bar in Windows Phone 8 . How to Programatically Create ApplicationBar in Windows Phone ? Call this function in the constructor of the page after the InitializeComponent method.

Comparing only Date in the DateTime datatype in C#

The DateTime datatype includes both the date as well as the time component to it in C#. By any chance , if you want to compare only the date part in the DateTime variable in C# , you can use the Date property defined in the DateTime class. How to compare only Date in the DateTime datatype in C# ?

How to generate C# classes from xsd file ?

You can easily generate the C# classes or entities from the xsd file using the VS Command Prompt. How to generate C# classes from xsd file ? Just launch the VS command prompt from the Windows 10 Start menu and run the following command xsd <Path of your.xsd file> /classes Eg : xsd “C:/test.xsd” /classes This would create the .cs files in the same folder…

Converting an Enum to Integer in C#

If you need to convert an enum to its numeric equivalent , you can simply cast the values to integer . Below is a sample code snippet that demonstrates how to do it. Converting an Enum to Integer in C#