3
我下面的代码给本地路径如何映射路径分配在C#中的字符串,MVC
using (StreamReader reader = new StreamReader(Server.MapPath("~/EmailStyle/TD-emailForCus.html")))
{
body = reader.ReadToEnd();
}
连接发送邮件与我的网站project.I然后使用这个作品properly.but我想要这样做。
stirng mypath = stirng.Format("~/EmailStyle/TD-emailForCus.html");
using (StreamReader reader = new StreamReader(Server.MapPath(mypath)))
{
body = reader.ReadToEnd();
}
当我这样做,它不能正常工作,可以给我一个像这样的地图路径。你的help.thanx。
什么是错误? – rt2800
当我在流读取器行中使用断点时。它通过它。但后来执行被停止.. – mithu