经过测试:直接可以用 '与之相关的XML文件 '
'
'
'
EarthWare
'
American
'
Nuric '
Devid
'
Ware
'
$19.0
'
'
'
Briage
'
American
'
Huston '
Madanad
'
Qindge
'
$20.0
'
'
'
Water
'
China
'
XIAN '
Mrs.NINGJIN
'
Ware
'
$20.0
'
'
'******************************************************************************** Try Dim xDoc As New Xml.XmlDocument '1 'MsgBox(Application.ExecutablePath) xDoc.Load(Application.ExecutablePath & "/../CD.xml") '2 Dim tmpNode As Xml.XmlNode '3 tmpNode = xDoc.Item("Message").ChildNodes(0) '4 MsgBox(tmpNode.Name) '5 If tmpNode.Name = "CD" Then '6 txtinitialcatalog = tmpNode.ChildNodes(0).InnerText '7 txtdatasource = tmpNode.ChildNodes(1).InnerText '8 txtuserid = tmpNode.ChildNodes(2).InnerText '9 txtpassword = tmpNode.ChildNodes(3).InnerText '10 End If '11 Catch ex As Exception '12 MessageBox.Show(ex.Message) '13 Finally '14 '关闭 End Try 将取出来得变量的值赋给你的textbox就可以了.如果要取出所有节点的属性值,需要用循环语句. 祝好运.