Tag: C#
Posting Data to a URL using WebClient in C#
Below is a sample code snippet demonstrating the usage of the WebClient to post data to the server in C#. How to Post data to a URL using WebClient in C# ?
How to Convert Byte Array to String in C#?
Below is a sample code snippet demonstrating the conversion of Byte Array to string in C#. How to Convert Byte Array to String in C#?
How to Save an Appointment in Windows Phone 8 using C# ?
If you want to allow the user to create or save an appointment within the Calendar application in Windows Phone 8 , you can do it using the SaveAppointmentTask launcher. How to Save an Appointment in Windows Phone 8 using C# ? To use the SaveAppointmentTask launcher , first enable the ID_CAP_APPOINTMENTS in the WMAppManifest file. Create an instance of the SaveAppointmentTask class and set…
Best Java Equivalent for LINQ (C#)
LINQ Query and Lambda expressions are one of the popular features of C# which helped the .NET developers in many ways. If you are a Java developer and wondering is there anything similar to this in Java ? ,this post will provide some insights on the additional APIs which could bring in the similar functionality Best Java Equivalent for LINQ (C#) jaque Another Java integrated…
How to format Integers with ToString() in C# ?
You can use the ToString() method to format the Integer value like showing the Hexadecimal value , padding with leading zeros or fixed length integer or Octal number . Below is a sample sourcecode to demonstrate How to format Integers with ToString() in C#
How to Create a Unique temporary file in C# ?
There are times when you want to create an unique temporary file in C# to deal with the storage of the data. In this case , you can use the Guid Name to get the unique name. How to Create a Unique temporary file in C# ?
C# Program to find the ASCII Value of a Character
Problem Write a program in Visual C# to find the ASCII value of the input character. How to find the ASCII value of a character in C# ? Output Abundantcode.com coding sample Enter a character : A 65
How to read a connection string from web.config file in ASP.NET ?
Assume that you have a connectionstring configured in the web.config file of your ASP.NET application and you wish to read it using C# within your application. How to read a connection string from web.config file in ASP.NET ? You can easily do that using the ConfigurationManager class defined in the System.Configuration namespace. 1. Ensure that the System.Configuration assembly is referenced in your project. 2. Add…
Using TryParse to parse string to integer in C#
You can use the int.TryParse to parse a string in to numbers . The function returns true if it suceeds in parsing the string to integer and false if it doesn’t.
Demonstrate Character Arrays in C#
Below is a sample sourcecode demonstrating Character Arrays in C#
How to download a file from a URL using C#?
You can use the WebClient class in C# to download a file. How to download a file from a URL using C#? Here’s a code snippet demonstrating how you can download a file using the instance of the WebClient class in C#.
How to Use LINQ query on a DataTable in C#?
Below is a sample code snippet that demonstrates the usage of the LINQ query on a DataTable in C#. How to Use LINQ query on a DataTable in C#?
Convert or cast integer to character in C#
Below is a sample sourecode demonstrating how to convert or cast int to char in C# Convert or cast integer to character in C#
What is the Difference between Readonly and Const in C# ?
If you want to have a field whose value cannot be changed at runtime , you can use either const or readonly keyword . What is the Difference between ReadOnly and Const in C# ? The constant fields must be defined when declaring and cannot be changed at runtime . It is a implicitly static . The read only field can be set when declaring…
Different Operators in C#
Below is a list of some of the operators in C# Arithmetic Operators + , – , * , / , % Logical Operators & , | , ^ , ~ , && , || , ! Increment and Decrement Operators ++ , — Bit Shift Operators << , >> Comparison Operators == , != , <> , <= , >= Assignment Operator = ,…
How to Use SpeechRecognizer in Windows Phone App using C#?
Below is a sample code snippet demonstrating how to use the SpeechRecognizerUI in your Windows Phone app using C#. Note that by default the speech recognizer API uses the default speech grammar accessed via the Microsoft cloud service and hence requires the network connection to be available for the below code snippet to work. How to Use SpeechRecognizer in Windows Phone App using C#? When…
What is Jagged Arrays in C# ?
The Jagged Array in simple terms is an array of array . Below is an example of the Jagged Array in C#. What is Jagged Arrays in C# ?
How to Get the Maximum value from a List of String using LINQ in C# ?
In one of the previous article , we explained how to get the maximum value from a list of integer using LINQ query in C# . What happens when the column is a string instead of integer ?. Below are 2 possibilities on how to get the maximum value from a list of string. How to Get the Maximum value from a List of String…
How to repeat the characters X times in C# ?
You can use the string constructor and pass the character that you wish to be present in it. The string constructor also takes the second parameter to specify the number of times the character to be repeated. How to repeat the characters X times in C# ? Below is a sample code snippet demonstrating how the string constructor can be used to repeat * 4…
How to Get the Max Value from a List of Integer using Lambda Expression in C#?
Below is a sample code snippet demonstrating the usage of Lambda expression to get the Max value from a list of integer in C#. How to Get the Max Value from a List of Integer using Lambda Expression in C#?