VB.NET Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB.NET Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML to XML
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
PFX
RSA
S/MIME
SMTP
Socket
Spider
SSH
SSH Tunnel
SSH Key
SFTP
Tar Archive
Upload
XML
XMP
Zip Compression
Misc

More Examples...
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

Byte Array
VB.NET FTPS
System.IO

 

 

 

 

 

 

Saving and Retrieving Data in XML

Saving and retrieving data in XML.

Download Chilkat .NET for 2.0 / 3.5 Framework

Download Chilkat .NET for 64-bit 2.0 / 3.5 Framework (x64)

Download Chilkat .NET for 1.0 / 1.1 Framework

'  Create an XML file with data that will later be loaded and
'  accessed by field name:
Dim xml As New Chilkat.Xml()
xml.Tag = "emailData"

xml.NewChild2("from","admin@chilkatsoft.com")
xml.NewChild2("toName","Chilkat Support")
xml.NewChild2("toAddr","support@chilkatsoft.com")
xml.NewChild2("subject","This is a test")
xml.NewChild2("body","This is an email body")

'  Save the XML:
Dim success As Boolean
success = xml.SaveXml("emailData.xml")
If (success <> true) Then
    MsgBox(xml.LastErrorText)
    Exit Sub
End If



Dim xml2 As New Chilkat.Xml()

'  Load the XML file:
success = xml2.LoadXmlFile("emailData.xml")
If (success <> true) Then
    MsgBox(xml2.LastErrorText)
    Exit Sub
End If

'  Access the data by name
TextBox1.Text = TextBox1.Text & xml2.GetChildContent("from") & vbCrLf
TextBox1.Text = TextBox1.Text & xml2.GetChildContent("toName") & vbCrLf
TextBox1.Text = TextBox1.Text & xml2.GetChildContent("toAddr") & vbCrLf
TextBox1.Text = TextBox1.Text & xml2.GetChildContent("subject") & vbCrLf
TextBox1.Text = TextBox1.Text & xml2.GetChildContent("body") & vbCrLf
TextBox1.Text = TextBox1.Text & "------" & vbCrLf

'  Let's say I want to load this into an email object:
Dim email As New Chilkat.Email()

email.From = xml2.GetChildContent("from")
Dim toName As String
Dim toAddr As String
toName = xml2.GetChildContent("toName")
toAddr = xml2.GetChildContent("toAddr")
email.AddTo(toName,toAddr)
email.Subject = xml2.GetChildContent("subject")
email.Body = xml2.GetChildContent("body")

TextBox1.Text = TextBox1.Text & email.GetMime() & vbCrLf


 

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

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

Mail Component · XML Parser