VB.NET Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB.NET Examples

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

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

Byte Array
VB.NET FTPS
System.IO

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

 

 

 

 

 

 

Create an XML Document

Download Chilkat .NET for 2.0 Framework

Download Chilkat .NET for 1.0 / 1.1 Framework

VB.NET sample code showing how to create an XML document.

        ' Create the root node of a new XML document.
        Dim xml As New Chilkat.xml()

        ' This is going to be a collection of contacts.
        xml.Tag = "companies"

        ' Create a child node to hold a contact record.
        ' Our "xml" object will now reference the new node.
        xml = xml.NewChild("company", "")

        ' Create a "company" record.  NewChild2 does not return the child node that is created.
        xml.NewChild2("name", "Chilkat Software, Inc.")
        xml.NewChild2("address", "1719 E Forest Ave")
        xml.NewChild2("city", "Wheaton")
        xml.NewChild2("state", "IL")
        xml.NewChild2("zip", "60187")
        xml.NewChild2("website", "http:'www.chilkatsoft.com")
        xml.NewChild2("phone", "312-953-3949")

        ' Move up the tree and create another contact record.
        ' GetParent2 updates our internal reference to the parent.
        xml.GetParent2()

        xml = xml.NewChild("company", "")
        xml.NewChild2("name", "Microsoft Corporation")
        xml.NewChild2("address", "One Microsoft Way")
        xml.NewChild2("city", "Redmond")
        xml.NewChild2("state", "WA")
        xml.NewChild2("zip", "98052")
        xml.NewChild2("website", "http:'www.microsoft.com")
        xml.NewChild2("phone", "425-882-8080")

        xml.GetParent2()
        xml = xml.NewChild("company", "")
        xml.NewChild2("name", "Intel Corporation")
        xml.NewChild2("address", "2200 Mission College Blvd.")
        xml.NewChild2("city", "Santa Clara")
        xml.NewChild2("state", "CA")
        xml.NewChild2("zip", "95052")
        xml.NewChild2("website", "http:'www.intel.com")
        xml.NewChild2("phone", "408-765-8080")

        xml.GetParent2()
        xml = xml.NewChild("company", "")
        xml.NewChild2("name", "Adobe Systems Incorporated")
        xml.NewChild2("address", "345 Park Avenue")
        xml.NewChild2("city", "San Jose")
        xml.NewChild2("state", "CA")
        xml.NewChild2("zip", "95110")
        xml.NewChild2("website", "http:'www.adobe.com")
        xml.NewChild2("phone", "408-536-6000")

        ' We can always get back to the root by calling GetRoot (or GetRoot2)
        xml.GetRoot2()

        ' Add the tag that specifies our character encoding.
        xml.Encoding = "iso-8859-1"

        ' Save the document.
        xml.SaveXml("companies.xml")


Important: The download for this example does not contain the ChilkatDotNet.dll which
must be downloaded and installed separately at http://www.chilkatsoft.com/downloads.asp.
Once installed, add a reference to the DLL in the project by following the instructions at
http://www.example-code.com/vbdotnet/step2.asp

 
 
 

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

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

Mail Component · XML Parser