Tag: How to
Different Tabs in the Package Manifest file in Universal App
The package manifest file in the Windows Store App and Windows Phone app (universal app) lets the developers to describe some of the key information about the application like the name , necessary device capabilities that the app can use and the requirements for the device to install the app etc. The name of the file would generally be Package.appxmanifest. Different Tabs in the Package…
How to return Binary File from a Action Method in ASP.NET Web API ?
There are times when you might want to serve binary files from your controller’s action method in ASP.NET MVC Web API. You can do this easily by setting the octet-stream content for the HttpResponseMessage as shown in the code snippet. How to return Binary File from a Action Method in ASP.NET Web API ?
How to Create a ShellToast(ToastPrompt) in Windows Phone 8 ?
Do you want to create a ShellToast from your Windows Phone 8 app ? . The Coding4fun toolkit provides some additional controls which can be used create a ShellToast in Windows Phone 8 app. How to Create a ShellToast(ToastPrompt) in Windows Phone 8 ? Below is a sample code snippet demonstrating how to achieve it using the ToastPrompt control from Coding4Fun.
C++ Program to add two integers
Problem Write a program in C++ to add two integers and display the result on the screen. C++ Program to add two integers Output Enter first number : 8 Enter second number : 2 8 + 2 = 10
GOTO Label in SQL Server
There are times when you want to jump to a specific section (Label) in the code when a condition satisfies. You can create a label and then use the GOTO statement to branch directly to the code. To create a label , simply specify the label name followed by the colon. Label1: Here’s a query demonstrating the usage of the Label named “RecordExistsLabel” and GOTO…
How to find if the value is null for a Nullable Type in c# ?
The Nullable type in C# provides the property HasValue which can be used to find if the value is null . Below is a sample sourecode snippet demonstrating How to find if the value is null for a Nullable Type in c# ? How to find if the value is null for a Nullable Type in c# ?
How to Change the Background Color of the Status Bar or System Tray in Windows Phone 8 ?
Are you looking forward to change the background color of the status bar or system tray in Windows Phone 8 ? Below is a sample code snippet that demonstrates how to do it . How to Change the Background Color of the Status Bar or System Tray in Windows Phone 8 ? In the below code snippet , the background color of the SystemTray is…
Creating Namespace in WinJS for Windows Store App ?
When developing Windows Store App using WinJS library , there are times when you want to create a namespace . You can use the WinJS.Namespace.define() method to create a namespace. Below is a sample code snippet demonstrating how to create a namespace in WinJS for Windows Store App using WinJS. Creating Namespace in WinJS for Windows Store App ?
Java – How to use Packages to organize code ?
Problem Statement You need to use packages in java to organize your code. Solution Your Java program might the following Classes Interfaces Enums Other types There are times when your program might grow larger including th number of java classes used. You might want to organize these source files to that it is easier to maintain and avoid other issues like class name conflicts. Inorder…
How to Disable the debug settings in ASP.NET MVC Web.config file ?
You can change or disable the debug settings in the ASP.NET MVC Web.config file by modifying the debug attribute of the Compilation element in the Web.config file. <system.web> <httpRuntime targetFramework=”4.5″ /> <compilation debug=”false” targetFramework=”4.5″ /> </system.web>
How to compare two Byte Arrays in C#?
Are you looking to compare two array of bytes in C#? Below is a sample code snippet that demonstrates how to do it. How to compare two Byte Arrays in C#?
How to Combine URL in C#?
The .NET Framework includes the Path.Combine feature which can be used to combine the strings into a path. How about having the same functionality to combine URL? How to Combine URL in C#? This is where the Uri class comes handy. The Uri class includes the constructor which can be used to combine URL. For example, if I need to combine “http://www.abundantcode.com” and “blogs/article1.html”, I…
How to allow only numbers in a textbox in C# Windows Application ?
Want to allow the user to enter only numbers or integer values in a textbox in a C# Winforms Application ? . Below is a sample code snippet that demonstrates how to do it . How to allow only numbers in a textbox in C# Windows Application ? Assume that the text box name is “actxt” , we can map the Key Press event of…
How to Get Auto Incrementing Version Number in Visual Studio 2013 ?
If you are a user looking for a simple trick to auto incrementing version number in Visual Studio 2013 , here we go. How to Get Auto Incrementing Version Number in Visual Studio 2013 ? The AssemblyInfo class does the trick for you . Just include the asterik (*) to the end of the AssemblyVersion attribute in the AssemblyInfo class and you are done ….
How to pass a function as parameter in JavaScript ?
There are times when you might want to pass a function as argument to another function in JavaScript. The function keyword can work in multiple ways. It can act as a operator and a statement as well. Additionally , you can create an expression as well. How to pass a function as parameter in JavaScript ? We can pass a function as a parameter to…
How to Convert byte[] to hex string in C# ?
To convert a byte array to hexadecimal string, you can use the BitConverter class in C#. How to Convert byte[] to hex string in C# ? Below is a sample code snippet demonstrating how to achieve this.
Match Statement in F#
Match Statement is similar to switch statement in C# . Below is a sample code snippet demonstrating the use of Match statement in F#. Match Statement in F#
How to Decode HTML Characters in C# ?
The .NET Framework 4.0 and above provides the WebUtility.HtmlDecode class which lets the developers to convert the string which are encoded with HTML characters to plain string . How to Decode HTML Characters in C# ? Below is a sample code snippet that demonstrates how to decode HTML characters in C#.
How to get the AM or PM value from a DateTime object in C# ?
There are times when you might want to get only the string AM or PM from the DateTime object that you have. How to get the AM or PM value from a DateTime object in C# ? You can get this by using the format specifiers in the ToString method as shown in the code snippet.
How to Create Comma Separated Strings from List of Strings in C#?
Below is a sample code snippet that demonstrates how one can easily create the comma separated strings from List<string> in C#. How to Create Comma Separated Strings from List of Strings in C#?