ぁwō'd溡緔*

.ㄧ┠愛.│是最後一次___". 傷.│也到此為止 _ ...ㄧ做個浪子..┻┕┅獨行天下!!

 protected string UrlPrefix(HttpRequest req)
        {
            string path = "http://"
                            + req.Url.Host.ToString();

            path += req.ApplicationPath != "/"
                    ? req.ApplicationPath + "/"
                    : req.ApplicationPath;
            return path;
        }

读取动态生成静态页面
string http =this.UrlPrefix(HttpContext.Current.Request)+strPath+"/default.aspx";
            WebRequest wr = WebRequest.Create(http);
            WebResponse wrs = wr.GetResponse();
            Stream stm = wrs.GetResponseStream();
            StreamReader st = new StreamReader(stm, Encoding.Default);
            StringBuilder sb = new StringBuilder();
            sb.Append(st.ReadToEnd());
            string Path=Server.MapPath("../../"+strPath+"/index.html");
            StreamWriter sw = new StreamWriter(Path, false, Encoding.UTF8, 20480);
            sw.Write(sb);
            sw.Flush();
            sw.Close();

posted on 2007-04-23 10:57  Top.Net  阅读(291)  评论(0编辑  收藏  举报