<HTML> <HEAD><LINK rel="stylesheet" type="text/css" name="defaultstyle" href="/cehttp/html/style.css"> <TITLE>Servlet Response Message</TITLE></HEAD> <BODY> <H2 align=center><H2> <HR> You are not logged on. Please logon first. <HR> </BODY></HTML>
try { WebClient client = new WebClient(); client.Credentials = new System.Net.NetworkCredential("username", "password"); byte[] pageData = client.DownloadData("url"); string pageHtml = Encoding.ASCII.GetString(pageData); Console.WriteLine(pageHtml); client.DownloadFile("url", @"C:\Downloads\071213.ACCT"); } catch (WebException webEx) { Console.WriteLine(webEx.ToString()); if (webEx.Status == WebExceptionStatus.ConnectFailure) { Console.WriteLine("Are you behind a firewall? If so, go through the proxy server."); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)