[[start]]
 

About This Site

Jared.TW is Jared’s personal wiki consisting of thoughts ,notes and ideas about algorithms and programming. Jared work for a research institute in Taiwan now.

--- Jared@Jared.TW  梁哲瑋

Jared's Blog

How TO: Use the WebClient Class

Tags:C#,Network Programming

2007/03/19

Use the WebClient Class

/*                                                      */
/* Use the WebClient Class                              */
/*                                                      */
/* Copyright (C) 2006 Jared Liang. All Rights Reserved. */
/* Email: Jared@Jared.TW                                */
/* URL:   http://Jared.TW                               */
/*                                                      */
private void loadhtml()
{
    WebClient wc = new WebClient();
    const string strUrl = "http://www.google.com/";
    byte[] reqHTML;
    reqHTML = wc.DownloadData(strUrl);
    UTF8Encoding objUTF8 = new UTF8Encoding();
    Console.WriteLine(objUTF8.GetString(reqHTML));
 
}

Jared@Jared.TW 梁哲瑋 2007/03/19

How TO: Post the Youtube Login Form with Webbrowser

Tags:C#,Network Programming

2007/03/16

Post the Youtube Login Form with Webbrowser

/*                                                      */
/* Save Webbrowser Documents                            */
/*                                                      */
/* Copyright (C) 2007 Jared Liang. All Rights Reserved. */
/* Email: Jared@Jared.TW                                */
/* URL:   http://Jared.TW                               */
/*                                                      */
private void mypost()
{
    string Text1 = "username=username";
    string Text2 = "password=password";
    string Text3 = "current_form=loginForm";
    string Text4 = "next=/index";
    string Text5 = "action_login=Log+In";
    UTF8Encoding encoder = new UTF8Encoding();
    webBrowser1.Navigate(@"http://www.youtube.com/login", null, encoder.GetBytes(Text1 + "&" + Text2 + "&" + Text3 + "&" + Text4 + "&" + Text5), "Content-Type: application/x-www-form-urlencoded\r\n");
}

Jared@Jared.TW 梁哲瑋 2007/03/16

 
start.txt · Last modified: 2007/03/19 03:23 by jared
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki