从根目录外部显示pic [英] Display pic from outside the root directory

查看:80
本文介绍了从根目录外部显示pic的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用正确的代码来显示图片,但它没有显示图片。是否有我的视觉工作室故障或视觉工作室需要任何特殊更改。

是否有任何文件夹共享的要求,这是在网站文件夹之外。



我尝试过:



代码是..

< asp:图片ID =b1runat =serverAlt =Picwidth =300height =400ImageUrl =q:/newfolder/1.jpg />

I am using right code to show pic but it does not showing pic. Is there is my visual studio fault or any special changes required in visual studio.
is there any requirement of folder sharing which is outside the website folder.

What I have tried:

Code is..
<asp:Image id="b1" runat="server" Alt="Pic" width="300" height="400" ImageUrl="q:/newfolder/1.jpg />"

推荐答案

此代码中的语法错误:

Syntax error in this code:
<asp:Image id="b1" runat="server" Alt="Pic" width="300" height="400" ImageUrl="q:/newfolder/1.jpg />"



更正是:


correction is:

<asp:Image id="b1" runat="server" Alt="Pic" width="300" height="400" ImageUrl="q:/newfolder/1.jpg" />




引用:

q:/newfolder/1.jpg

q:/newfolder/1.jpg



不是URL,因此不能用于访问服务器上的文件。

从客户端的角度来看,这会尝试访问客户端计算机上的文件,这是禁止的。

read link由Karthik Bangalore提供了更多详情。


Is not an URL, thus can't be used to access a file on server.
From client side point of view, this try to access a file on client computer, which is forbidden.
read link provided by Karthik Bangalore for more details.


这篇关于从根目录外部显示pic的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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