我将本地图片使用网页格式显示:
<a href="C:\Documents and Settings\Administrator\My Documents\temViewFile\2011-05-09 [email protected]"><img Src="C:\Documents and Settings\Administrator\My Documents\temViewFile\2011-05-09 [email protected]" style=width:600px;height:300px;>在我自己电脑里面能够看到这个图片(点击图片链接也能),但是在公司电脑就只能看到 X,不显示图片.
同样点击 图片链接也看不到图片,
不知道为啥,是因为文件名中含有"@"?还是....
如何解决呢?我的VB生成 html语句为:
    Print #1, "  <tr>"
    Print #1, "    <th>" & "<a href=" & Pic_File_Address(i) & "><img Src=" & Pic_File_Address(i) & " style=" & "width:600px;height:300px;>" & "</th>"
    Print #1, "    <th>" & "<a href=" & Pic_File_Address(i + 1) & "><img Src=" & Pic_File_Address(i + 1) & " style=" & "width:600px;height:300px;>" & "</th>"
    Print #1, "  </tr>"其中Pic_File_Address()数组为图片地址:
比如: C:\Documents and Settings\Administrator\My Documents\temViewFile\2011-05-09 [email protected]

解决方案 »

  1.   

    "C:\Documents and Settings\Administrator\My Documents\temViewFile\2011-05-09 204753" & chr(64) & "1.jpg"chr(64)就是@
      

  2.   

    还是说一下我的要求吧。
    我将图片地址保存到数据中,图片是放在一个公共的文件夹中.
    通过搜索记录将所有图片文件名保存到数组 Pic_File_Address()中,然后用网页形式将 这些图片显示出来.按照你的方法,我得将Pic_File_Address()内容 中"@"用 chr(64)替换掉,是否有其他的方法呢(目前我自己电脑不替换也能显示图片,所以看不到效果,呵呵只能明天更新效果了)?另外空格是否也是造成不能显示的原因?
      

  3.   

    受教了!
    呵呵在公司试了下还是不行,后来直接改了文件名:4.jpg。发现一样的结果,问题在哪呢??
      

  4.   

    你将生成的html直接贴上来看看,肯定不是:
    <a href="C:\Documents and Settings\Administrator\My Documents\temViewFile\2011-05-09 [email protected]"><img Src="C:\Documents and Settings\Administrator\My Documents\temViewFile\2011-05-09 [email protected]" style=width:600px;height:300px;>
      

  5.   

        Print #1, "  <tr>"
        Print #1, "    <th>" & "<a href=""" & Pic_File_Address(i) & """><img Src=""" & Pic_File_Address(i) & """ style=" & """width:600px;height:300px;"">" & "</th>"
        Print #1, "    <th>" & "<a href=""" & Pic_File_Address(i + 1) & """><img Src=""" & Pic_File_Address(i + 1) & """ style=" & """width:600px;height:300px;"">" & "</th>"
        Print #1, "  </tr>"这样就像就行了。你之前生成的应该:
    <img Src=C:\Documents and Settings\Administrator\My Documents\temViewFile\2011-05-09 [email protected] style=width:600px;height:300px;>
    含有空格,这样src就不能识别了,竟然做假数据误导大家!
      

  6.   

    澄清一点:
    1.目前生成的html在我的电脑中是能显示图片的;
    2.Pic_File_Address()中的内容为:"C:\Documents and Settings\Administrator\My Documents\temViewFile\2011-05-09 [email protected]",这个描述错误,非常抱歉;
    其中地址赋值:
    str_Tem_Add = str_Tem_File & "\" & View_FileName(i) & ".jpg"
    Pic_File_Address(i)=Chr(34) & str_Tem_Add & Chr(34)
    str_Tem_Add为不含有""的图片地址;后来根据 dbcontrols的提示,将 @用 Chr(36)替换,新的赋值:
    str_Tem_Add = str_Tem_File & "\" & Mid(View_FileName(i), 1, 17) & Chr(64) & Mid(View_FileName(i), 19, Len(View_FileName(i)) - 18) & ".jpg"
    Pic_File_Address(i)=Chr(34) & str_Tem_Add & Chr(34)以上2种方式所生成的html文件都在公司尝试过,不能显示图片,而且用下面这个:
    <img Src="C:\Documents and Settings\Administrator\My Documents\temViewFile\1.jpg">
    也不显示图片.
    另外有看到:
    <img src="盘符/文件夹名/文件名(图片名)" /> 
    这种方式的,明天去试试...
      

  7.   

    C:\Docume~1\Admin~1\MyDocu~1\temVie~1\1.jpg用短路径试下.Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long这个API可以生成短路径.
      

  8.   

    可是按照你的代码并没有在src值的两端加引号啊?你可不可以放出最初的代码,不要对回答者隐瞒什么。<img Src="C:\Documents and Settings\Administrator\My Documents\temViewFile\1.jpg">
    建议改成下面的试试:
    <img Src="file:///C:/Documents and Settings/Administrator/My Documents/temViewFile/1.jpg">
      

  9.   

    1.我的代码生成的Html在我自己电脑中能显示出图片,SRC值是带有""中(Pic_File_Address(i)=Chr(34) & str_Tem_Add & Chr(34)),我不知道是我没有说清楚还是有人没有看清楚.
    http://342151559.qjwm.com/down_690517.html(数据库地址)
    http://342151559.qjwm.com/down_690516.html(软件地址)
    生成的文件如上,可以尝试.
    我自己生成html+网页代码:2.我的问题是在我自己的电脑上能显示图片的网页拿到公司去就不行了,另外我直接在D:建立网页显示D盘的1.jpg,各种各样的方式尝试了还是不行:3.检查Internet 选项:显示图片是打勾的.另外公司IE版本为6.0的,我自己电脑IE8.0(不知道是否为版本低的原因):
    所以回到根本问题,如何实现用网页显示本地或者公司网络共享文件夹中的图片(撇开我的代码)?
      

  10.   

    http://hi.csdn.net/attachment/201105/11/2943862_130511603042CG.jpg
    http://hi.csdn.net/attachment/201105/11/2943862_1305116047XHLb.jpg
    http://hi.csdn.net/attachment/201105/11/2943862_1305115962PaNA.jpg
    晕倒上传图片都弄错几次。
      

  11.   

    楼主可以把文件打包上传到svn给大家看看
      

  12.   

    “我得不到答案你们也别想得到分” 楼主大人,结贴可以返回给自己一半分的,无满意结贴还得输入密码的烦不烦的。别人没有功劳也有苦劳的。论坛签名======================================================================

    当您的问题得到解答后请及时结贴.

    http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
    http://topic.csdn.net/u/20100428/09/BC9E0908-F250-42A6-8765-B50A82FE186A.html
    http://topic.csdn.net/u/20100626/09/f35a4763-4b59-49c3-8061-d48fdbc29561.html如何给分和结贴?
    http://community.csdn.net/Help/HelpCenter.htm#结帖如何给自己的回帖中也加上签名?
    http://blog.csdn.net/q107770540/archive/2011/03/15/6250007.aspx如何给自己安装一双火眼金睛?
    http://blog.csdn.net/sysdzw/archive/2011/04/07/6306619.aspx
      

  13.   

    好吧,你貌似符合其中的一条。
    http://blog.csdn.net/sysdzw/archive/2011/04/07/6306619.aspx