kevininstructor's solution will give you the value for the customerDeploymentLicenseCode attribute you're looking for.
-----
The reason your code is having issues is that you're calling ReadLine twice. You call it in your if statement and then once you've determined you're on the correct line you call ReadLine again which from the looks of your sample returns an empty string.
There's another issue with your code in that if you were to set customerLicCode to the whole line you'd end up with customerDeploymentLicenseCode="dgAAAJEL0iTaEM0BkLI9HW00" in the variable and not the the value you're looking for. You'd need to split the string and get just the value.
All that being said it's an XML file and you should use the tools you have available rather than trying to reinvent the wheel to parse your file.




Reply With Quote