asp.net to html

WebRequest mywebReq ; 
        WebResponse mywebResp ; 
        StreamReader sr ; 
        
string strHTML ;
        StreamWriter sw;
        
private void Page_Load(object sender, System.EventArgs e)
        
{
            mywebReq 
= WebRequest.Create("http://www.c-sharpcorner.com/faq.asp");
            mywebResp 
= mywebReq.GetResponse();
            sr 
= new StreamReader(mywebResp.GetResponseStream());
            sr 
= new StreamReader(mywebResp.GetResponseStream(), System.Text.Encoding.ASCII);
            strHTML 
= sr.ReadToEnd();
            sw 
= File.CreateText(Server.MapPath("temp.html"));
            sw.WriteLine(strHTML);
            sw.Close();
            Response.WriteFile(Server.MapPath(
"temp.html"));
       }

你可能感兴趣的:(html,c,.net,asp.net,asp)