使用asp.net c在html中透析图像时出错 [英] error in diaplsying image in html using asp.net c#

查看:65
本文介绍了使用asp.net c在html中透析图像时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的下面的代码中,我在html tabl中显示一个图像,只有当我提供了图像的绝对路径时才能正常工作,如果我已经为图像提供了相对路径,那么不工作......在我的本地系统中它正在工作我需要在服务器上更新它在图像路径上抛出错误....请找到任何soln



Hi in my below code i am displaying an image with in html tabl it''s working fine only if i''ve provided absolute path of an image , if i have give an relative path for an image it''s not working...In my local system it''s working i need to update under server where it was throwing error on image path....Pls find any soln

StringBuilder sbb = new StringBuilder();
       sbb.AppendLine("<html><body><center><table width='100%' cellspacing='0' border='1'");
       sbb.AppendLine("<tr>");
       sbb.AppendLine("<td>");
       sbb.AppendLine("<center>");
       sbb.AppendLine("<img src='G:/Sayeed/xlent Proj/Matrimony/Matrimony Updated Final/images/cmp_logo.gif'>");
       sbb.AppendLine("</center>");
       sbb.AppendLine("</td>");
       sbb.AppendLine("</tr>");
       sbb.AppendLine("<tr>");
       sbb.AppendLine("<td align='right'>");
       sbb.AppendLine("Title");
       sbb.AppendLine("</td>");
       sbb.AppendLine("</tr>");
       sbb.AppendLine("<tr>");
       sbb.AppendLine("<td align='right'>");
       sbb.AppendLine("Company Address 1");
       sbb.AppendLine("</td>");
       sbb.AppendLine("</tr>");
       sbb.AppendLine("<tr>");
       sbb.AppendLine("<td align='right'>");
       sbb.AppendLine("Phone No");
       sbb.AppendLine("</td>");
       sbb.AppendLine("</tr>");
       sbb.AppendLine("</table></center></body></html>");

推荐答案

据我所知,将图像保存在托管服务器中,例如:www.xyz.com/images/ cmp_logo.gif然后在代码中提供此图像的URL。因为在托管服务器中,你没有足够的权限访问其他驱动器。替换为以下代码:http://www.xyz.com/images/cmp_logo.gif
as per my knowledge, keep the image in hosting server for ex: www.xyz.com/images/cmp_logo.gif Then give this image url in the code. because in hosting servers some you don''t have enough permission to access other drives. replace with following code http://www.xyz.com/images/cmp_logo.gif


这篇关于使用asp.net c在html中透析图像时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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