C# Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

C# Examples

Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML to XML
HTTP
IMAP
Encryption
MHT / HTML Email
MIME
RSA Encryption
S/MIME
Socket
Spider
Tar Archive
Upload
XML
XMP
Zip Compression


More Examples...
Email Object
POP3
SMTP
RSS
Atom
String
Byte Array
Self-Extractor

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

Create a Simple XML Document in C#

Download Chilkat .NET for 2.0 / 3.5 Framework

Download Chilkat .NET for 1.0 / 1.1 Framework

This is an example demonstrating how to create a simple XML document in C#.

// This code creates XML that looks like this:
/*
 * <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 * <rootNode>
 * <firstChild color="orange" speed="fast">This is the first child</firstChild>
 * <secondChild>
 *   <grandChild>This is the grandchild</grandChild>
 * </secondChild>
 * </rootNode>
 * 
 * */

private void CreateXML_Click(object sender, System.EventArgs e)
{
	Chilkat.Xml doc = new Chilkat.Xml();
	doc.Encoding = "utf-8";
	doc.Standalone = true;
	doc.Tag = "rootNode";

	Chilkat.Xml firstChild = doc.NewChild("firstChild","This is the first child");
	firstChild.AddAttribute("color","orange");
	firstChild.AddAttribute("speed","fast");

	Chilkat.Xml secondChild = doc.NewChild("secondChild","");
	Chilkat.Xml grandChild = secondChild.NewChild("grandChild","This is the grandchild");

	doc.SaveXml("simple.xml");
	textBox1.Text = doc.GetXml();
}


 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2008 Chilkat Software, Inc. All Rights Reserved.

Email Component · XML Parser