本文介绍了找不到网络驱动器映像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题已经被问很多次,但都没有那么已经解决了我的情况。

我有这个简单的code

 图像F = Image.FromFile(@\\\\网络\\ imagenes \\ FOLDER0 \\ 1690D-PC.tif);

但它抛出:

  System.IO.FileNotFoundException \\\\网络\\ imagenes \\ FOLDER0 \\ 1690D-PC.tif


  1. 我共有访问以相关的网络

  2. 我可以找到在该位置图片。我复制路径,START + R,粘贴的路径和图像打开。

  3. 是在该服务器的所有图像是相同的。

但不是唯一的情况依然存在:


  1. 我另一台电脑进行测试,以检查是否就是是一个IIS问题,或者
    什么,但是当我测试了它抛出相同(2 PC无法访问
    该文件中,在他们完全访问... ...怪异)

  2. 当即时通讯在发展,我可以normaly发现图像的一切工作的,但当我部署和
    上传到我的本地IIS和其他电脑,抛出相关的异常
    (FileNotFoundException异常)。

  3. 我PARNER具有相同的code(几乎相同proyect,只是一些
    diferrent功能和公共的),他可以发现图像和
    显示它。

我碰到这种情况,上周五,我还没有一个解决方案又走了过来。

进出口愿意听听你的建议。

更新2。
更多信息:

有2个应用程序,从服务器请求的图像和这些应用程序可以正常找到它。的这些应用程序都在我的本地IIS。

Updte

Tracktrace

  [FileNotFoundException异常:\\\\ DAVID-PC \\ imagenes \\ FOLDER0 \\ 1690D-PC.tif]
   System.Drawing.Image.FromFile(字符串文件名,布尔useEmbeddedColorManagement)472351
   System.Drawing.Image.FromFile(字符串文件名)+6
   Muckup.Controllers.HomeController.Index()在C:\\用户\\ PKM \\文档\\ Visual Studio 2010的\\项目\\ Muckup \\ Muckup \\ \\控制器HomeController.cs:20
   lambda_method(封闭,ControllerBase,对象[])+62
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase控制器,对象[]参数)+14
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext,IDictionary`2参数)211
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext,ActionDescriptor actionDescriptor,IDictionary`2参数)+27
   System.Web.Mvc.Async<> c__DisplayClass42< BeginInvokeSynchronousActionMethod> b__41()+28
   System.Web.Mvc.Async<> c__DisplayClass8`1< BeginSynchronous> b__7(IAsyncResult的_)+10
   System.Web.Mvc.Async.WrappedAsyncResult`1.End()+57
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult的asyncResult)+48
   System.Web.Mvc.Async<> c__DisplayClass39< BeginInvokeActionMethodWithFilters> b__33()+57
   System.Web.Mvc.Async<方式>&c__DisplayClass4f LT; InvokeActionMethodFilterAsynchronously> b__49()+223
   System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult)+10
   System.Web.Mvc.Async.WrappedAsyncResult`1.End()+57
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult的asyncResult)+48
   System.Web.Mvc.Async&LT;&GT; c__DisplayClass2a&LT; BeginInvokeAction&GT; b__20()+24
   System.Web.Mvc.Async&LT;方式&gt;&c__DisplayClass25 LT; BeginInvokeAction&GT; b__22(IAsyncResult的asyncResult)+102
   System.Web.Mvc.Async.WrappedAsyncResult`1.End()+57
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult的asyncResult)+43
   System.Web.Mvc&LT;&GT; c__DisplayClass1d&LT; BeginExecuteCore&GT; b__18(IAsyncResult的asyncResult)+14
   System.Web.Mvc.Async&LT;方式&gt;&c__DisplayClass4 LT; MakeVoidDelegate&GT; b__3(IAsyncResult的AR)+23
   System.Web.Mvc.Async.WrappedAsyncResult`1.End()+62
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult的asyncResult)+57
   System.Web.Mvc.Async&LT;方式&gt;&c__DisplayClass4 LT; MakeVoidDelegate&GT; b__3(IAsyncResult的AR)+23
   System.Web.Mvc.Async.WrappedAsyncResult`1.End()+62
   System.Web.Mvc.Controller.EndExecute(IAsyncResult的asyncResult)+47
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult的asyncResult)+10
   System.Web.Mvc&LT;&GT; c__DisplayClass8&LT; BeginProcessRequest&GT; b__3(IAsyncResult的asyncResult)+25
   System.Web.Mvc.Async&LT;方式&gt;&c__DisplayClass4 LT; MakeVoidDelegate&GT; b__3(IAsyncResult的AR)+23
   System.Web.Mvc.Async.WrappedAsyncResult`1.End()+62
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult的asyncResult)+47
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult的结果)+9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()9514812
   System.Web.HttpApplication.ExecuteStep(IExecutionStep一步,布尔和放大器; completedSynchronously)+155


解决方案

您是否尝试过使用双反斜杠代替@来查找文件?可能是值得一试。

 图像F = Image.FromFile(* FULLPATH * \\\\ \\\\销售网络\\\\ imagenes \\\\ FOLDER0 1690D-PC.tif);

I know this question have been asking many times but none of then have solved my situation.

I have this simple code

   Image f = Image.FromFile(@"\\NetWork\imagenes\folder0\1690D-PC.tif");

But it throws:

System.IO.FileNotFoundException \\NetWork\imagenes\folder0\1690D-PC.tif
  1. I have total access to the related network
  2. I do can find the image in that location. I copy the path, START + r, pasted the path and the image opens.
  3. Is the same for all images in that server.

But the situation not only remains there:

  1. I tested in another pc to checked if is was a IIS problem orwhatever, but when I tested it throws the same(2 pc cannot access tothat file, having they full access... weird...)
  2. When im in development, I can find the image everything work normaly, but when i deploy andupload to my local iis and the other pc, throw the related exception(FileNotFoundException).
  3. My parner has the same code(almost the same proyect, just with somediferrent functionality and public) and he can find the image anddisplay it.

I ran into this situation last friday and i havent came up with a solution yet.

Im willing to hear all your suggestions.

Update 2.More info:

There are 2 more application that request images from that server and those application can find it normally. Those application are in my local IIS.

Updte

Tracktrace

[FileNotFoundException: \\DAVID-PC\imagenes\folder0\1690D-PC.tif]
   System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement) +472351
   System.Drawing.Image.FromFile(String filename) +6
   Muckup.Controllers.HomeController.Index() in C:\Users\pkm\Documents\Visual Studio 2010\Projects\Muckup\Muckup\Controllers\HomeController.cs:20
   lambda_method(Closure , ControllerBase , Object[] ) +62
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +211
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
   System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +28
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +48
   System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +57
   System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +223
   System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +48
   System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +24
   System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +102
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +43
   System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +47
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9514812
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
解决方案

Have you tried using double back slashes instead of @ to find the file? Might be worth trying.

 Image f = Image.FromFile(" *FullPath* \\NetWork\\imagenes\\folder0\\1690D-PC.tif");

这篇关于找不到网络驱动器映像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 10:06