On my dev computer everything was working fine and dandy but when I tested the program on a different Windows7 computer I was getting a System.UriFormatException
: Invalid URI: There is an invalid sequence in the string. On the following code: Uri.UnescapeDataString(section);
At first I thought the second computer was receiving different data from the dev pc, so I copied the html string that was failing to a file and reduced my code to this:
static void Err(string s){/*Picked up by external logging*/}
private static void GetValue()
{
try
{
var html = File.ReadAllText("ld.txt");
//Retrieve section we want
var section = Regex.Match(
html,
"etc_etc(.*): ",
RegexOptions.Singleline)
.Groups[1].ToString();
Uri.UnescapeDataString(section);
}
catch (Exception ex)
{
Err(ex.ToString());
}
}
Works fine on the dev pc, but the second computer receives the exception again. They're both loading the exact same html from the exact same ld.txt
file and then doing the exact same thing with it.. and both PC's are x64 Win7. What gives?