添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
System.Web.UI.Page page = new Page(); StringWriter writer = new StringWriter(); page.Server.Execute(path, writer); FileStream fs; fs = File.Create(page.Server.MapPath("") + "\\" + outpath); byte[] bt = System.Text.Encoding.Default.GetBytes(writer.ToString()); fs.Write(bt, 0, bt.Length); fs.Close(); Response.Write("寫入成功"); ※須將網站的目錄權限開啟為寫入。 [範例下載] System.Web.UI.Page page = new Page();
StringWriter writer = new StringWriter();
page.Server.Execute(path, writer);

FileStream fs;

fs = File.Create(page.Server.MapPath("") + "\\" + outpath);
byte[] bt = System.Text.Encoding.Default.GetBytes(writer.ToString());
fs.Write(bt, 0, bt.Length);
fs.Close();

Response.Write("寫入成功");
※須將網站的目錄權限開啟為寫入。 [範例下載]