VB.NET Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

VB.NET Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML Conversion
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...
Amazon S3
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

 

 

 

 

 

 

(VB.NET) Methods for Getting Attributes

Demonstrates some methods for getting attribute name/values.

The input XML, available at http://www.chilkatsoft.com/data/car.xml, is this:

<root>
    <car color="black" make="mercedes" model="C350" hp="302" engine="v6" type="sedan">Mercedes Benz C350</car>
</root>

Download: Chilkat .NET Assemblies

Dim xml As New Chilkat.Xml()
Dim carNode As Chilkat.Xml
Dim numAttr As Long
Dim horsepower As Long
Dim i As Long

Dim success As Boolean
'  The sample input XML is available at http://www.chilkatsoft.com/data/car.xml
success = xml.LoadXmlFile("car.xml")
If (success <> true) Then
    TextBox1.Text = TextBox1.Text & xml.LastErrorText & vbCrLf
    Exit Sub
End If


'  Navigate to the "car" node, which is the 1st child:
carNode = xml.FirstChild()

'  Get the value of the "model" attribute:
TextBox1.Text = TextBox1.Text & "model = " & carNode.GetAttrValue("model") & vbCrLf

'  Get the value of the "hp" attribute as an integer:
horsepower = carNode.GetAttrValueInt("hp")
TextBox1.Text = TextBox1.Text & "horsepower = " _
     & horsepower & vbCrLf

'  Iterate over the attributes and show the name/value of each:
numAttr = carNode.NumAttributes

i = 0
While i < numAttr
    TextBox1.Text = TextBox1.Text & carNode.GetAttributeName(i) _
         & ": " & carNode.GetAttributeValue(i) & vbCrLf
    i = i + 1
End While







 

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

Mail Component · XML Parser