twelvecodespent
Member
- Joined
- Dec 15, 2010
- Messages
- 5
- Programming Experience
- 1-3
I'm new to .net programming and have ran into an issue I can't seem to find an answer for where ever I look. I have a multi-line text box where one would input the name of a computer. I want to read each computer as an array element and go to the corresponding .xml file to pull down data and write it to excel. Here is the basic code I'm using:
Dim arrComputers As String = TextBox1.Text.Split(vbCrLf)
For Each strComputer As String In arrComputers
'XML Parsing
Dim reader As XmlTextReader = New XmlTextReader("C:\XML_Files\" & strComputer & ".xml")
While reader.Read()
'Do something
End While
Next
It works perfect when there is only 1 computer listed. However once I have more than a single computer I get an error telling me I have an illegal character path at "While reader.Read()". Any help would be immensely appreciated. Thanks in advance for any advice you can give.
Dim arrComputers As String = TextBox1.Text.Split(vbCrLf)
For Each strComputer As String In arrComputers
'XML Parsing
Dim reader As XmlTextReader = New XmlTextReader("C:\XML_Files\" & strComputer & ".xml")
While reader.Read()
'Do something
End While
Next
It works perfect when there is only 1 computer listed. However once I have more than a single computer I get an error telling me I have an illegal character path at "While reader.Read()". Any help would be immensely appreciated. Thanks in advance for any advice you can give.
Last edited: