ASP.NET MS Chart 我可以使用 Http Handler 从 Web 服务读取和写入临时图像

发布于 2024-12-28 05:18:22 字数 146 浏览 7 评论 0原文

我的应用程序部署到不使用粘性会话的网络场(不幸的是,这不是一个选项)。我想将图表图像写入 Web 服务并从那里读取它,因为客户端浏览器并不总是重定向到图像渲染到的同一服务器。由于安全限制,我无法使用文件服务器,并且无法从 IIS 服务直接访问数据库,只能通过 wcf 服务访问。

My application is deployed to a web farm that does not use sticky sessions (unfortunately this is not an option). I would like to write the chart image to a web service and read it from there as the client browser does not always get redirected to the same server the image has been rendered to. I cannot use a file server due to security restrictions and do not have access to a database from the IIS service directly only to a wcf service.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

贱贱哒 2025-01-04 05:18:22

所以你问:

客户-> WS 呼叫 -> ?? ->生成图表的HTTPHandler?

我不确定你为什么需要网络服务部分。

您可以使用 HTTPHandler 来生成图像,这可以很好地工作。只需实例化图表对象并将其写入输出流即可。

一些关于从网络保存到流的示例代码。

Response.ContentType = "image/png";
//Response.AddHeader("Content-Disposition", "attachment; filename=test.png"); // You only want this to save as attachment
Chart4.SaveImage(Response.OutputStream, ChartImageFormat.Png);        
Response.End();

So you are asking:

client -> WS Call -> ?? -> HTTPHandler that generates chart?

I'm not sure why you need the web service part.

You can use an HTTPHandler to generate the image this can work really well. Just instantiate your chart object and write it to the output stream.

Some sample code about saving to a stream from the nets.

Response.ContentType = "image/png";
//Response.AddHeader("Content-Disposition", "attachment; filename=test.png"); // You only want this to save as attachment
Chart4.SaveImage(Response.OutputStream, ChartImageFormat.Png);        
Response.End();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文