I am having some problems with a webclient download. I am trying to collect some data form a website, and use the data (separate column) in my calculations. I get no error when simply copying and pasting data (and manually deleting the empty lines in the bottom of the file). But when trying to automate it - i get the "illegal characters in path" error. Think it's \r and "" at the end of the file - thats the problem. I have attempted to use .TrimEnd, but I am still getting the error. Any ideas?
Output in locals window.(after modified code to "download.Split('\n');) last values... "\r" "\r" ""
static void userInterface()
{
string[] lines;
//Console.Write("Enter ticker: ");
//string contract = Console.ReadLine();
try
{
WebClient client = new WebClient();
string downloadString = client.DownloadString
("http://ds01.ddfplus.com/historical/queryeod.ashx?username=XX&password=XXX&symbol=clk12&maxrecords=30&data=daily");
downloadString = downloadString.TrimEnd('\r');
//lines = File.ReadAllLines(downloadString);
lines = downloadString.Split('\n');
int high = 1;
Program.TA(DateColumn(lines, high), OpenColumn(lines, high + 1), HighColumn(lines, high + 2),
LowColumn(lines, high + 3), CloseColumn(lines, high + 4));
}