将图表图像存储在本地驱动器上 [英] Storing chart image on local drive

查看:62
本文介绍了将图表图像存储在本地驱动器上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在ASP.net项目中使用图表MS图表控件.它按我的需要以图表形式提供输出.但是现在我想将该图表图像存储在项目目录中的某些位置,因此我在我的.aspx页面:

< asp:图表ID ="Chart3" runat ="server" Height ="25px"调色板="None" Width ="150px" ImageLocation ="D:\ Yogesh Experiment \ proSES_Solution_28_Jan_2011 \ ChartImages \ Sparkline" ImageStorageMode ="UseImageLocation" ImageType ="Jpeg">

存储图表图像.

我还在我的web.config文件中包含以下行.

< add key ="ChartImageHandler" value ="storage = memory; deleteAfterServicing = false;">



但是图像没有存储在目录中,相反,它给了我以下错误:

``D:\ Yogesh Experiment \ proSES_Solution_28_Jan_2011 \ ChartImages \ Sparkline.jpeg''不是有效的虚拟路径.


谁能帮我解决问题.


谢谢&问候
Yogesh

Hello all,

Am using chart MS chart control in my ASP.net project.Its giving me the output in the form of chart as i need it.But now i want to store that chart image some where in project directory.So i followed the following procedure in my .aspx page:

<asp:Chart ID="Chart3" runat="server" Height="25px" Palette="None" Width="150px" ImageLocation="D:\Yogesh Experiment\proSES_Solution_28_Jan_2011\ChartImages\Sparkline" ImageStorageMode="UseImageLocation" ImageType="Jpeg">

To store the chart image.

I also include following line in my web.config file.

<add key="ChartImageHandler" value="storage=memory;deleteAfterServicing=false;">



But image is not stored in directory.Instead of that it gives me an following error:

''D:\Yogesh Experiment\proSES_Solution_28_Jan_2011\ChartImages\Sparkline.jpeg'' is not a valid virtual path.


Can anybody help me solve the problem.


Thanks & Regards
Yogesh

推荐答案

当然,此路径无效. Web使用相对于站点根目录的路径,该路径被映射到带有域名的URL(不带子目录).从URL架构和域名开始编写的每个绝对路径都将根据根路径映射到文件系统绝对路径.相对路径相对于引荐页的位置.

此处说明: http://msdn.microsoft.com/en-us/library/ms178116.aspx [ ^ ].

至于就服务器本地文件系统而言的绝对路径,HTTP服务器根本无法访问这些路径.

—SA
Of course this path is not valid. Web works with paths relative to the site root directory which is mapped onto URL with domain name without sub-directories. Every absolute path written starting with URL schema and domain name is mapped to the file system absolute path depending on the root path. Relative path is relative to the location of the referring page.

This is explained here: http://msdn.microsoft.com/en-us/library/ms178116.aspx[^].

As to the absolute path in terms of server-local file systems, such paths are not accessible by the HTTP server at all.

—SA


这篇关于将图表图像存储在本地驱动器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆