【www.gdgbn.com--WebService】

GetURLHtml.aspx
<%@ Page language="c#" Codebehind="GetURLHtml.aspx.cs" Src="GetURLHtml.aspx.cs" AutoEventWireup="false" Inherits="Lion.Web.Forum.WebForm1" %>

 
  Lion互动网络=>利用WebClient和WebRequest类获得网页源代码
  
 
 
  

   http://www.lionsky.net/mywebsite/index.aspx
    
   

   
  

 

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;
namespace Lion.Web.Forum
{
 ///
 /// WebForm1 的摘要说明。
 ///

 public class WebForm1 : System.Web.UI.Page
 {
  protected System.Web.UI.WebControls.TextBox TextBox1;
  protected System.Web.UI.WebControls.Button Button1;
  protected System.Web.UI.WebControls.Button Button2;
  protected System.Web.UI.WebControls.TextBox UrlText;
  protected System.Web.UI.WebControls.TextBox ContentHtml;
  protected System.Web.UI.WebControls.TextBox TextBox2;

本文来源:http://www.gdgbn.com/asp/6205/