C# Basic Operator Overloading

Operator Overloading So far in this tutorial we have created classes to represent real-world objects complete with their appropriate methods and properties. These objects have not required the implementation of arithmetic operators as this type of functionality was not appropriate. In this article, we will create a class that does… Continue reading

How to write XML file by using dotnet code?

void CreateXmlFile(String xmlFilePath) { XmlTextWriter xmlWriter = new XmlTextWriter(xmlFilePath, Encoding.UTF8); xmlWriter.WriteStartDocument(true); xmlWriter.WriteStartElement(“Departments”); //Root Element xmlWriter.WriteStartElement(“Department”); //Department Element xmlWriter.WriteStartAttribute(“Name”); //Attribute “Name” xmlWriter.WriteString(“Development”); //Attribute Value xmlWriter.WriteEndAttribute(); xmlWriter.WriteStartElement(“Employees”); //Started Employees Element xmlWriter.WriteStartElement(“Employee”); //Started Employee Element xmlWriter.WriteStartAttribute(“Name”); //Attribute “Name” xmlWriter.WriteString(“Sabu C.Alex”); //Attribute Value xmlWriter.WriteEndAttribute(); xmlWriter.WriteStartAttribute(“Age”);//Attribute “Age” xmlWriter.WriteString(“28”);//Attribute Value xmlWriter.WriteEndAttribute(); xmlWriter.WriteString(“Sabu C.Alex is working as… Continue reading