今日最大怪事,无法载入xml文件
2066 2003-12-16 05:58:23 我用xml文件来代替ini文件。在csdn查了许多资料,以下是代码片断
Imports System.Net
Imports System.IO
Imports mshtml
Imports System.Xml
Dim xmlInfo As New XmlDocument
Dim mAppPath As Object = Application.StartupPath
If Strings.Right(mAppPath, 1) <> "\" Then
mAppPath = mAppPath & "\"
End If
'MsgBox(mAppPath)
xmlInfo.Load(mAppPath & "info.xml")
Dim node As XmlNode = xmlInfo.DocumentElement.SelectSingleNode("netsh")
Dim name As String = node.SelectNodes("name").Item(0).Value
MsgBox(name)
运行到xmlInfo.Load(mAppPath & "info.xml")
程序提示:
未处理的“System.Xml.XmlException”类型的异常出现在 microsoft.visualbasic.dll 中。
其他信息: 系统错误。
我已经添加引用microsoft xml v5.0
info.xml在bin目录下。
我看csdn的例子,我的操作并没有什么问题,为什么会这样?