出于某种原因,我今天早上有一个巨大的大脑放屁。
我无法从下面的代码中得到任何东西......它总是弹出 0,并且永远不会填充 _Qry,即使 _MBXml 已正确填充(在调试期间悬停显示它)
_MetaBasePath += "IIS6-MetaBase.xml" '"metabase.xml"
_MBXml = XDocument.Load(_MetaBasePath, LoadOptions.PreserveWhitespace)
_Qry = (From n In _MBXml.<IIsWebServer>
Select New Typing.MetaBase() With {
.Binding = Common.IsNull(Of String)(n.@ServerBindings, String.Empty)
}).ToList()
MsgBox(_Qry.Count)
这是 IIS 6 metaBase.xml 文件的示例...
<?xml version ="1.0"?>
<configuration xmlns="urn:microsoft-catalog:XML_Metabase_V64_0">
<IIsWebServer Location ="/LM/W3SVC/1174460368"
AuthFlags="0"
SSLCertHash="8251cc2a9671150ac107aee3d78006b032f9bc36"
SSLStoreName="MY"
SecureBindings="184.106.185.111:443:"
ServerAutoStart="TRUE"
ServerBindings="184.106.185.111:80:beta.turbokits.com"
ServerComment="TurboKits Beta"
>
</IIsWebServer>
</configurarion>