<% @ Page Language = " C # " Codebehind = " Geturlhtml. aspx. CS " SRC = " Geturlhtml. aspx. CS " Autoeventwireup = " False " Inherits = " Lion. Web. Forum. webform1 " %>
< Html >
< Head >
< Title > Lion interactive network => Use WebClient and webrequest to obtain webpagesSource code </ Title >
< Meta HTTP - Equiv = " Content-Type " Content = " Text/html; charset = gb2312 " >
</ Head >
< Body >
< Form runat = " Server " >
< ASP: textbox ID = " Urltext " Runat = " Server " Width = " 50% " > HTTP: // Www.lionsky.net/mywebsite/index.aspx </ASP: textbox>
< ASP: button ID = " Button1 " Runat = " Server " Text = " Use WebClient to obtain " > </ ASP: button > & Nbsp;
< ASP: button ID = " Button2 " Runat = " Server " Text = " Use webrequest to obtain " > </ ASP: button > < BR >
< ASP: textbox ID = " Contenthtml " Runat = " Server " Width = " 100% " Height = " 360px " Textmode = " Multiline " > </ ASP: textbox >
</ Form >
</ Body >
</ Html >
Geturlhtml. aspx. CS
Using System;
Using System. collections;
Using System. componentmodel;
Using System. Data;
Using System. drawing;
Using System. Web;
Using System. Web. sessionstate;
Using System. Web. UI;
Using System. Web. UI. webcontrols;
Using System. Web. UI. htmlcontrols;
# Region Generated by the web Form DesignerCode
Override Protected Void Oninit (eventargs E)
{
//
// Codegen: This call is required by the ASP. NET web form designer.
//
Initializecomponent ();
Base . Oninit (E );
}
/// <Summary>
/// The designer supports the required methods-do not use the code editor to modify
/// The content of this method.
/// </Summary>
Private Void Initializecomponent ()
{
This . Button1.click + = New System. eventhandler ( This . Button#click );
This . Button2.click + = New System. eventhandler ( This . Button2_click );
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.