ASP Code Samples
PHP Code Samples
JavaScript Code Samples
C# Code Samples

C# Code Samples

C# Executing MySQL Command with C#

This code provides with connecting the MySQL database and executing the SQL command.


C# Sorting array

To sort array of primitive types such as int, double or string use method Array.Sort(Array) with the array as a paramater.


C# Custom DateTime Formatting

Following examples demonstrate how are the format specifiers rewritten to the output.


C# Getting queryString value in C#

You can use "Request.QueryString" to get a QueryString value from the previous pages URL.


C# Writting Formatted Date in DataGrid

Using this code allows to write selected format date text comming from the database in the Datagrid. dataformatstring="{0:dd/MM/yyyy}" code allow user to write formatted date like 06.01.2014.


C# Switch Example

The switch statement is a control statement that selects a switch section to execute from a list of candidates.


C# Get files from directory (with specified extension)

You can specify search pattern. You can use wildcard specifiers in the search pattern


C# Calculating factorial value

This code calculates the factorial value of number given in textbox


C# Reading a Text File One Line at a Time

This example reads the contents of a text file by using the static methods ReadAllText and ReadAllLines from the System.IO.File class.


C# Select XML Nodes by Name

To find nodes in an XML file you can use XPath expressions


C# Foreach Loop

The foreach statement iterates through a collection that implements the IEnumerable interface. In contract to for statement, the foreach statement does't use the indexes.


C# Writing to a Text File

This example writes a string to a text file using the WriteLine method of the StreamWriter class.


C# Reading XML File and Addind to DropDownList

This code provides to read XML file and add to the Dropdownlist. This code read the "students.XML" file from local disk and this XML file contains students' information such as name, lastname, class, number.


C# Delete all files

These examples show how to delete all files (*.*) from a folder in C#.


C# Sent message to the user with Javascript

This code provides to send message to the user with using Javascript alert() function. "Hello World" alert message is shown after running this example.


C# Delete all files and directories

These examples show how to delete all files (*.*) and folders in C#.


C# On Button Click() Open new form

Show Form2, when the button1, in Form1, is clicked.


C# Opening new application (exe program) in C#

In C# Process.Start (a static method) calls external applications.


  email : info@kodornekleri.com