我有一个ASPX网站,该网站可以抓取屏幕截图并将其返回给我。该站点可以在Dev服务器上运行,但是当移动到Prod时,无论如何(即使是空白),我都会在同一行上收到错误消息。这是我的错误:
这是我用来发出API请求的代码。我将html中的图片网址设置为下载的文件位置。在我迁移到Prod之前,它一直对我有用。开发服务器和生产服务器具有相同的配置,并且所有代码都已更改以反射(reflect)迁移。
protected void Screen_Shot()
{
string input = TextBox1.Text;
using (var client = new WebClient())
{
string filename = @"C:\Screen_Shot.jpg";
string destination = @"http://api.screenshotmachine.com/?key=111111&size=N&url=" + input;
try{
client.DownloadFile(destination, filename);
Image1.Visible = true;
}
catch(Exception)
{
Image1.Visible = true;
Image1.ImageUrl = @"C:\Windows\Temp\screenshot_error.jpg";
}
}
}
最佳答案
我能够通过清洗解决方案然后重新构建来清除错误。谢谢大家的帮助。
关于c# - C#代码同一行上的ASPX网站错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39492614/