Click here to Skip to main content
15,882,055 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("");
                request.Headers.Add("Authorization", "Bearer 672wbhnr4gt8rd5tvh9lw9n3o7");
                request.PreAuthenticate = true;
                request.Method = "GET";
                var response = (HttpWebResponse)request.GetResponse();
                Stream dataStream = response.GetResponseStream();
                StreamReader reader = new StreamReader(dataStream);
                string responseFromServer = reader.ReadToEnd();
                int i = responseFromServer.IndexOf(',')+1;
               string s = responseFromServer.Substring(i);
                int i1 = s.IndexOf(',')-6;
               string s1 = s.Substring(6,i1);
               WebClient wb = new WebClient();
               wb.Headers.Add("Authorization", "Bearer 672wbhnr4gt8rd5tvh9lw9n3o7");
               byte[] myDataBuffer = wb.DownloadData(s1);

System.ArgumentException: Illegal characters in path. at System.IO.Path.CheckInvalidPathChars(String path) at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength) at System.IO.Path.GetFullPathInternal(String path) at System.IO.Path.GetFullPath(String path) at System.Net.WebClient.GetUri(String path) at System.Net.WebClient.DownloadData(String address) at WebApplication4.WebForm1.Button7_Click1(Object sender, EventArgs e) in D:\RMS\visualstudio\Projects\WebApplication4\WebApplication4\WebForm1.aspx.cs:line 210
Updated 21-Apr-13 21:18pm
CHill60 22-Apr-13 5:09am    
Use the Improve question link in green above to post details of the line of code that is throwing the exception and what the content of the path variable is.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900