我需要从 url 保存一个页面 - 这个页面在我自己的应用程序中 - 以 html 格式。然后,此 html 将通过电子邮件发送给用户。有人知道怎么做吗?
最佳答案
好吧,您必须在服务器上执行此操作才能发送电子邮件 - 所以在最坏的情况下,只需:
using(WebClient client = new WebClient()) {
string html = client.DownloadString(address);
}
也有可能在 MVC 中直接完成它 - 也许 RenderPartial
?
关于c# - 从 ASP.NET MVC 中的 Url 获取 Html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/525718/