ASP Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

ASP Examples

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

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

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

 

 

 

 

 

 

Saving and Retrieving Data in XML

Saving and retrieving data in XML.

Download Chilkat Email ActiveX

Download Chilkat XML ActiveX

Download Chilkat IMAP ActiveX

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%

'  Create an XML file with data that will later be loaded and
'  accessed by field name:
set xml = Server.CreateObject("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:

success = xml.SaveXml("emailData.xml")
If (success <> 1) Then
    Response.Write xml.LastErrorText & "<br>"

End If

set xml2 = Server.CreateObject("Chilkat.Xml")

'  Load the XML file:
success = xml2.LoadXmlFile("emailData.xml")
If (success <> 1) Then
    Response.Write xml2.LastErrorText & "<br>"

End If

'  Access the data by name
Response.Write Server.HTMLEncode( xml2.GetChildContent("from")) & "<br>"
Response.Write Server.HTMLEncode( xml2.GetChildContent("toName")) & "<br>"
Response.Write Server.HTMLEncode( xml2.GetChildContent("toAddr")) & "<br>"
Response.Write Server.HTMLEncode( xml2.GetChildContent("subject")) & "<br>"
Response.Write Server.HTMLEncode( xml2.GetChildContent("body")) & "<br>"
Response.Write Server.HTMLEncode( "------") & "<br>"

'  Let's say I want to load this into an email object:
set email = Server.CreateObject("Chilkat.Email2")

email.From = xml2.GetChildContent("from")

toName = xml2.GetChildContent("toName")
toAddr = xml2.GetChildContent("toAddr")
email.AddTo toName,toAddr
email.Subject = xml2.GetChildContent("subject")
email.Body = xml2.GetChildContent("body")

Response.Write Server.HTMLEncode( email.GetMime()) & "<br>"


%>
</body>
</html>

 

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

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