【发布时间】:2012-09-24 17:32:54
【问题描述】:
我正在尝试将 aspx 页面转换为图像,即将其保存为 png 文件。我为此使用了iecapt。我在 aspx 页面上有很多文本框。问题是文本框值未保存在图像文件中。我只是获取源文件图像。希望我能得到一些建议。 谢谢你
protected void btnsend_Click(object sender, EventArgs e) {
string url = "http://localhost:4101/WebForm3.aspx";
if(Request.Params["weburl"] != null)
{
url = Request.Params["weburl"];
}
string savepath = String.Format("C:\\IECapt\\{0}.png" , System.Guid.NewGuid());
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "C:\\IECapt\\IECapt.exe";
process.StartInfo.Arguments = String.Format("\"{0}\" \"{1}\"",url,savepath);
process.StartInfo.UseShellExecute = false;
process.Start();
process.WaitForExit();
process.Dispose();
Response.Clear();
Response.ContentType = "image/png";
Response.WriteFile(savepath);
Response.End();
}
【问题讨论】:
-
你尝试和这个一样,但是有图片stackoverflow.com/questions/12342519/…