TechyMedia

A .NET Technology blog | .NET,C# Progamming,C# tutorials,WPF WCF|Software Engineer

NAVIGATION - SEARCH

Namespaces In C#

Namespace in C# is logical grouping of related classes.Classes which are related can be logically grouped in named collection called namespace. So a namespace will give unique fully qualified identifier to a class,which avoids name conflicts.There is no physical mapping of namespaces in C#.That is classes with same namespace can scatter across folders,not necessarily be in same folder/project. [More]

C# 6.0 Features | What is new in C# 6.0

C# 6.0 if the latest version of C# language which ships with Visual Studio 2015. C#.NET 6.0 comes with a set of new advanced features which are mainly targeted to improve the developer experience.A new compiler technology named "Roslyn" also introduced this time which is an open source under the Apache 2 licence.With Roslyn compiler efficiency is improved and feature integration to languages are made ready. Accordingly in C# version 6.0 Microsoft has added number of new features. [More]

Deserialize XML to object c#

Deserialize XML to object c# -Reading the data stored in a XML file to a class object.Deserialize method from the XmlSerializer class is used for reading/deserializing the XML file data to the class object.Sample Method to Deserialize the xml file.Method which creates an object and deserialize the xml data to the object .
Deserialize XML to object c# -Reading the data stored in a XML file to a class object.Deserialize method from the XmlSerializer class is used for reading/deserializing the XML file data to the class object.Sample Method to Deserialize the xml file.Method which creates an object and deserialize the xml data to the object . [More]

Write Class Data to an XML File in C# | serialize c# xml

XmlSerializer class is used for writing/storing the class object data to an XML file. This is Serialization of class object. C# - Write Class Data to an XML File code sample. XmlSerializer xmlSerializer = new System.Xml.Serialization.XmlSerializer(objectToSerialize.GetType());
XmlSerializer class is used for writing/storing the class object data to an XML file.
This is Serialization of class object. C# - Write Class Data to an XML File code sample. XmlSerializer xmlSerializer = new System.Xml.Serialization.XmlSerializer(objectToSerialize.GetType()); [More]

Read XML File in C# - Read Content From XML File

Example for the XMLTextReader class to read the xml element names. Read XML Content From a File- C#.
Example for the XMLTextReader class to read the xml element names. Read XML Content From a File- C#. [More]

Browse Network using FolderBrowserDialog C# Control

.NET How to Browse Network using FolderBrowserDialog Control: Type folderBrowserType = folderBrowserDialog1.GetType();System.Reflection.FieldInfofieldInfo = folderBrowserType .GetField("rootFolder",BindingFlags.NonPublic | BindingFlags.Instance); fieldInfo .SetValue(folderBrowserDialog1, (Environment.SpecialFolder)18);
.NET How to Browse Network using FolderBrowserDialog Control: Type folderBrowserType = folderBrowserDialog1.GetType();System.Reflection.FieldInfofieldInfo = folderBrowserType .GetField("rootFolder",BindingFlags.NonPublic | BindingFlags.Instance);
fieldInfo .SetValue(folderBrowserDialog1, (Environment.SpecialFolder)18); [More]

Writing to File In C#

File IO handling is a common activity in all programming languages.File IO operations such as Read from a File and Write to file are very easy to handle in C#.In this example you will see some sample Write to File operations in C#. Here I am explaining of writing to a text file.For write to file in C# we can use StreamWriter class.StreamWriter class has method WriteLine which can be used for writing strings to the text file. [More]

How to handle File access IO exception

File accessing file you may get IO exception was unhandled, the process cannot access the file because it is being used by another process.The reason fot this exception may be lke,File you are trying to open not even exist, File is in process by another thread,File is already kept open etc.How to handle this exception.
File accessing file you may get IO exception was unhandled, the process cannot access the file because it is being used by another process.The reason fot this exception may be lke,File you are trying to open not even exist, File is in process by another thread,File is already kept open etc.How to handle this exception. [More]

String value enum with space in between - Description Attribute

String value enum with space seperated words in C# need special attention.You need to use Description attribute.See the article for defining the enum and fetching the value.
String value enum with space seperated words in C# need special attention.You need to use Description attribute.See the article for defining the enum and fetching the value. [More]

Button click open Form 2 and close Form 1

A common case in normal windows application is to Open a new form(say Form2) while clicking a button in Form1 and close Form1 also.Read to know the different ways to achieve this.
A common case in normal windows application is to Open a new form(say Form2) while clicking a button in Form1 and close Form1 also.Read to know the different ways to achieve this. [More]