Y
yyy
This problem bothers me for a long time:
I use WebClient.DownloadData in order to read text from an HTML
document this way:
WebClient c = new WebClient();
string html=
ASCIIEncoding.Default.GetString(c.DownloadData("http://www.test.com"));
When I run the code, I get this error message after a few seconds:
Projects\RE\MainForm.cs:line 93
What can I do to solve it? It worked once and stopped working a few
months ago.
I use WebClient.DownloadData in order to read text from an HTML
document this way:
WebClient c = new WebClient();
string html=
ASCIIEncoding.Default.GetString(c.DownloadData("http://www.test.com"));
When I run the code, I get this error message after a few seconds:
Unable to connect to the remote server.See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Net.WebException: The underlying connection was closed:
c:\Documents and Settings\Y\My Documents\SharpDevelopat System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at System.Net.WebClient.DownloadData(String address)
at RE.MainForm.Button1Click(Object sender, EventArgs e) in
Projects\RE\MainForm.cs:line 93
MouseButtons button, Int32 clicks)at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m,
System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at
msg, IntPtr wparam, IntPtr lparam)at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
What can I do to solve it? It worked once and stopped working a few
months ago.