为什么vb.net找不到存在的文件? [英] Why is vb.net not finding a file that exists ?

查看:118
本文介绍了为什么vb.net找不到存在的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有人能发现这里有什么问题我将永远感激不尽!!!



基本上,我运行的VB.net程序正在播放,它说我的L:驱动器上的文件不存在,显然它确实存在! (如果有帮助,我的L:驱动器是利马设备)



我链接的图像显示错误,文件夹中的文件和实际存在的文件编辑(这是在错误发生后打开的。)



虽然这个问题并不总是发生...



http://i63.tinypic.com/4i24ac.jpg



我尝试了什么:



当PC说它不存在时访问文件!

If somebody can spot what is wrong here I will be eternally grateful !!!

Basically, a VB.net program that I run is playing up, it says that a file on my L: drive doesn't exist, when it clearly does !!! (If it helps, my L: drive is a Lima device)

The image I have linked to shows the error, the file in its Folder and the file actually being edited (this was opened after the error occurred).

This problem doesn't ALWAYS happen though ...

http://i63.tinypic.com/4i24ac.jpg

What I have tried:

Accessing the file when the PC says it doesn't exist !!!

推荐答案

映射的驱动器是特定于用户的。您是否在其他用户下运行appdomain? IIS或管理员?



如果是这样,那么您将需要使用完整的//服务器/文件夹路径或将驱动器映射为运行时。这将保证它们被映射为正确的用户。我有几个.bat提交,我将在启动和关闭为我映射驱动器的应用程序运行。
Mapped drives are user specific. Are you running the appdomain under a different user? IIS or Administrator?

If so, then you will either have to use the full //server/folder path or map the drives as runtime. That will guarantee that they are mapped for the correct user. I had a couple of .bat filed I would run on startup and shutdown of the app that mapped the drives for me.


我不知道为什么这不起作用。虽然我很确定Andy Lanng的网络和地图建议在这种情况下并且在这种情况下(即使用Lima设备及其提供的软件来访问作为标准硬盘驱动器的外部HD),但它似乎并不相关。



根据我的所有经验和直觉,我将数据文件中的行硬编码为代码中的变量数组,以及程序的工作方式,现在是最重要的事情!!!
I have no idea why this will not work. Whilst I am quite sure that Andy Lanng's Network & Mapping advice is spot on, in this instance and under these circumstances (i.e. using a Lima device & their supplied software to access the external HD as a standard Hard Drive) it doesn't appear relevant.

Against all my experience and instincts & I have hard-coded the lines from the data file into a variable Array within the code and that way the program works, which right now is the most important thing !!!


这篇关于为什么vb.net找不到存在的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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