ashx 绝对路径得到物理路径

//先得到模板页所在的路径
string phyPath = context.Server.MapPath("/p02style.html");
//得到模板的所有内容
string str = System.IO.File.ReadAllText(phyPath);

//读取母版页 替换占位符
//占位 需要被替换
str = str.Replace("${trs}", sb.ToString());

//返回给浏览器
context.Response.Write(str);

猜你喜欢

转载自www.cnblogs.com/Neil-Peng/p/9140409.html