C# 在网站上进行旋转后刷新我的图像

C# 在网站上进行旋转后刷新我的图像,c#,asp.net,image,iis,C#,Asp.net,Image,Iis,在Windows ASP.NET的IIS 6.1下运行的网站上,我在执行旋转后刷新图像时遇到问题 我使用以下c#函数: img.RotateFlip(RotateFlipType.Rotate90FlipNone); img.Save(output, System.Drawing.Imaging.ImageFormat.Jpeg); 操作效果很好,当我直接用服务器上的文件系统打开图像时,图像已完成90°旋转,但在服务器上的站点上,图像未刷新。。。(页面已重新加载) 另一方面,在localhos

在Windows ASP.NET的IIS 6.1下运行的网站上,我在执行旋转后刷新图像时遇到问题

我使用以下c#函数:

img.RotateFlip(RotateFlipType.Rotate90FlipNone);
img.Save(output, System.Drawing.Imaging.ImageFormat.Jpeg);
操作效果很好,当我直接用服务器上的文件系统打开图像时,图像已完成90°旋转,但在服务器上的站点上,图像未刷新。。。(页面已重新加载)

另一方面,在localhost中,图像会被刷新

这就好像图像在缓存图像上被阻塞

以下是我试图强制重新加载图像的内容:

我试图通过添加以下内容来更改图像的URL:

URL + "?no-cache=" + new DateTime().Date.Ticks;
我试着让梅塔:

<meta http-equiv="Cache-control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
什么都不管用,你还有别的解决办法吗


谢谢

请尝试以下代码:

<br>
img.RotateFlip(RotateFlipType.Rotate90FlipNone);

'Set the content type<br>
response.contenttype="image/jpeg"

'send the bitmap to the outputstream<br>
img.save(response.outputstream, imageformat.jpeg)

'tidy up<br>
img.dispose() 

img.RotateFlip(RotateFlipType.Rotate90FlipNone); '设置内容类型
response.contenttype=“image/jpeg” '将位图发送到输出流
img.save(response.outputstream,imageformat.jpeg) “整理”
img.dispose()
旋转图像后,请在视图中的“代码”下尝试

$(".MainImg").attr("src", "@path" + ActualDocName + ".png?cache=none");
对于旋转,请在控制器中尝试以下操作

if (System.IO.File.Exists(inpathpng))
 {
      System.Drawing.Image flipimage = System.Drawing.Image.FromFile(inpathpng);
      flipimage.RotateFlip(RotateFlipType.Rotate90FlipXY);
      flipimage.Save(inpathpng);
 }

希望这可以帮助其他人

您尝试过这里列出的所有标题标签吗?谢谢你的建议,但它不起作用。问题可能出在IIS上,因为它在localhost中工作,但不使用IIS托管?
if (System.IO.File.Exists(inpathpng))
 {
      System.Drawing.Image flipimage = System.Drawing.Image.FromFile(inpathpng);
      flipimage.RotateFlip(RotateFlipType.Rotate90FlipXY);
      flipimage.Save(inpathpng);
 }