• using System;  
  • susing System.Collections.Generic;   
  • using System.Web;   
  • using System.Web.UI;   
  • using System.Web.UI.WebControls;   
  • using System.IO;   
  • using System.Net;   
  • using System.Text;   
  •   
  • public partial class Thief : System.Web.UI.Page   
  • {   
  •     protected void Page_Load(object sender, EventArgs e)   
  •     {   
  •        string url = "http://www.myspace.cn/";       //要获取的网页地址   
  •        WebRequest req = WebRequest.Create(url);   
  •        WebResponse res = req.GetResponse();   
  •        Stream resStream = res.GetResponseStream();   
  •        StreamReader sr = new StreamReader(resStream, Encoding.UTF8);   
  •        string contentHTML = sr.ReadToEnd();    //读取网页的源代码      
  •        Response.Write(contentHTML);   
  •        resStream.Close();   
  •        sr.Close();   
  •     }   
  • }
  • 相关文章:

    • 2021-09-17
    • 2021-11-27
    • 2021-08-02
    • 2021-12-14
    • 2021-11-27
    • 2022-01-01
    • 2021-11-27
    • 2021-08-15
    猜你喜欢
    • 2021-11-27
    • 2021-11-27
    • 2021-11-26
    • 2021-11-27
    • 2021-11-27
    • 2021-11-27
    • 2021-11-27
    • 2021-11-27
    相关资源
    相似解决方案