Click here to Skip to main content
15,890,579 members
Home / Discussions / C#
   

C#

 
GeneralRetrieving HTML Source for a given website Pin
Anand Mudliar28-Dec-04 7:07
Anand Mudliar28-Dec-04 7:07 
GeneralRe: Retrieving HTML Source for a given website Pin
Jesse Squire28-Dec-04 7:34
Jesse Squire28-Dec-04 7:34 
GeneralRe: Retrieving HTML Source for a given website Pin
Anand Mudliar28-Dec-04 8:25
Anand Mudliar28-Dec-04 8:25 
GeneralRe: Retrieving HTML Source for a given website Pin
Nick Parker28-Dec-04 8:53
protectorNick Parker28-Dec-04 8:53 
GeneralRe: Retrieving HTML Source for a given website Pin
Jesse Squire28-Dec-04 9:08
Jesse Squire28-Dec-04 9:08 
GeneralRe: Retrieving HTML Source for a given website Pin
Anand Mudliar28-Dec-04 22:12
Anand Mudliar28-Dec-04 22:12 
GeneralRe: Retrieving HTML Source for a given website Pin
Jesse Squire29-Dec-04 4:50
Jesse Squire29-Dec-04 4:50 
GeneralRe: Retrieving HTML Source for a given website Pin
Nick Parker28-Dec-04 7:57
protectorNick Parker28-Dec-04 7:57 
Here is a quick example, you should be able to fit this into your codebase and it requires no UI.

public string GetPageContent(string user, string pass, string url)
{
    WebRequest wreq;
    WebResponse wres;
    WebProxy proxy;
    StreamReader sr;
    String content = string.Empty;

    try
    {
        proxy = new WebProxy("someproxy", false);
        NetworkCredential cred = new NetworkCredential(user, pass,
                                   "somedomain");

        wreq = HttpWebRequest.Create(url);
        wreq.Proxy = proxy;
            proxy.Credentials = cred;

        wres = wreq.GetResponse();
        sr = new StreamReader(wres.GetResponseStream());
        content = sr.ReadToEnd();
        sr.Close();
    }
    catch(Exception e)
    {
        Console.WriteLine("Error:" + e.Message);
    }

    return content;
}


- Nick Parker
My Blog | My Articles

GeneralFle Version Pin
Anonymous28-Dec-04 7:03
Anonymous28-Dec-04 7:03 
GeneralRe: Fle Version Pin
Jesse Squire28-Dec-04 9:21
Jesse Squire28-Dec-04 9:21 
GeneralChanging the scroll bar color Pin
LannieK28-Dec-04 5:34
LannieK28-Dec-04 5:34 
GeneralLicensing, Encryption and .NET Reflector Pin
PaleyX28-Dec-04 3:58
PaleyX28-Dec-04 3:58 
GeneralRe: Licensing, Encryption and .NET Reflector Pin
Javier Lozano28-Dec-04 6:21
Javier Lozano28-Dec-04 6:21 
GeneralRe: Licensing, Encryption and .NET Reflector Pin
Skynyrd28-Dec-04 8:43
Skynyrd28-Dec-04 8:43 
GeneralA loop in write statement Pin
Anonymous28-Dec-04 3:43
Anonymous28-Dec-04 3:43 
GeneralRe: A loop in write statement Pin
Identity Undisclosed28-Dec-04 7:46
Identity Undisclosed28-Dec-04 7:46 
GeneralRe: A loop in write statement Pin
Anonymous28-Dec-04 11:34
Anonymous28-Dec-04 11:34 
GeneralRe: A loop in write statement Pin
Bill Dean29-Dec-04 16:55
Bill Dean29-Dec-04 16:55 
GeneralRe: A loop in write statement Pin
jablo30-Dec-04 8:48
jablo30-Dec-04 8:48 
GeneralRe: A loop in write statement Pin
Bill Dean30-Dec-04 9:11
Bill Dean30-Dec-04 9:11 
GeneralTerminating ThreadPool Paths Pin
Tristan Rhodes28-Dec-04 2:09
Tristan Rhodes28-Dec-04 2:09 
GeneralRe: Terminating ThreadPool Paths Pin
Guinness4Strength28-Dec-04 8:52
Guinness4Strength28-Dec-04 8:52 
GeneralRe: Terminating ThreadPool Paths Pin
Tristan Rhodes28-Dec-04 13:35
Tristan Rhodes28-Dec-04 13:35 
GeneralDoes anybody have the C# Sorted ListView by Carlos H. Perez Pin
dfsgdsfgdfg28-Dec-04 1:51
dfsgdsfgdfg28-Dec-04 1:51 
GeneralDoes anybody have the C# Sorted ListView by Carlos H. Perez Pin
dfsgdsfgdfg28-Dec-04 1:50
dfsgdsfgdfg28-Dec-04 1:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.