Using XMLTextReader to loop thru nodes/attributes
This is what needs to be parsed:
<Configuration>
<Server name = "a">
<IP>127.0.0.1</IP>
<Type>1</Type>
<Patch>2, 1, 1 6643</Patch>
<Signature></Signature>
<IsOffline>0</IsOffline> // boolean
</Server>
<Server name = "a">
<IP>127.0.0.2</IP>
<ServerType>2</ServerType>
<Patch>2, 1, 1 6641</Patch>
<Signature></Signature>
<IsOffline>0</IsOffline> // boolean
</Server>
<Updater>
<CurrentVersion>1.0.0</CurrentVersion>
<IsCriticalUpdate>1</IsCriticalUpdate> // boolean
<Signature>sdsa323h234jkh23kh324</Signature>
<DownloadLink>www.google.com</DownloadLink>
<NeedsUnpacked></NeedsUnpacked> // boolean
<Message></Message>
</Updater>
<Misc>
<BannedUser>24A33FTU53BN5F3AA34</BannedUser>
</Misc>
</Configuration>
The nodes that have "// boolean" need to be gathered from the parsing as so. Thanks so much.
Why does this code keep throwing an exception?
static void Main(string[] args)
{
//SelectQuery query = new SelectQuery("Select * from Win32_DiskDrive where DeviceId='c:'");
ManagementObjectSearcher searcher = new ManagementObjectSearcher("Select * FROM Win32_DiskDrive WHERE Index = 0");
foreach (ManagementObject mo in searcher.Get())
{
Console.WriteLine(mo["SerialNumber"].ToString());
}
Console.Read();
}
PS. I'm using C# by the way.

