RT

解决方案 »

  1.   

    http://www.code-123.com/html/2008719231951580.html请参考。
      

  2.   

    可以用发送http请求,获取页面,然后写入文件
      

  3.   


    string mbPath = Server.MapPath("htm/view_page.htm");
                Encoding code = Encoding.GetEncoding("gb2312");
                StreamReader sr = null;
                StreamWriter sw = null;
                string str = null;            try
                {
                    sr = new StreamReader(mbPath, code);
                    str = sr.ReadToEnd();            }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    sr.Close();
                }
                string fileName = DateTime.Now.ToString("yyyyMMddHHmmss") + ".htm";
                str = str.Replace("$time$", "123");//替换time
                str = str.Replace("$click$", "123");//替换click
                str = str.Replace("$title$", "123");//替换Title
                str = str.Replace("$content$", "123");//替换content            try
                {
                    sw = new StreamWriter(Server.MapPath("htm/")+fileName, false, code);
                    sw.Write(str);
                    sw.Flush();            }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    sw.Close();
                    Response.Redirect("htm/" + fileName);
                }等先给个HTML的模版