在VB.NET中存在文件存在的问题检查 [英] Problem Checking If A File Exists In VB.NET

查看:233
本文介绍了在VB.NET中存在文件存在的问题检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在检查文件是否存在以下代码;

Hi,
I''m checking if a file exists with the following code;

展开 | 选择 | Wrap | 行号

推荐答案

它总是说假的原因是文件不存在,知道原因吗?因为你有一个\t,这意味着在这里放一个标签字符。

这很容易错过。

这样做:
The reason it always says false is that the file doesn''t exist, know why? Because you have a \t in there, which means "put a tab character here".
It''s an easy miss.
Do this:
展开 | 选择 | Wrap | 行号



它总是说错的原因是文件没有''存在,知道为什么吗?因为你有一个\t,这意味着在这里放一个标签字符。

这很容易错过。

这样做:
The reason it always says false is that the file doesn''t exist, know why? Because you have a \t in there, which means "put a tab character here".
It''s an easy miss.
Do this:
展开 | 选择 | Wrap | 行号


我认为它是*您的*特定环境。我使用vs2005并复制粘贴该代码,它工作正常。

告诉我文件不存在,然后我创建文件,它告诉我它确实存在。

你确定文件确实存在吗?
I think it is *your* specific environment. I use vs2005 and copy pasted that code and it worked correctly.
Told me file didn''t exist, then I create the file and it told me it did exist.

Are you SURE the file actually exists?


这篇关于在VB.NET中存在文件存在的问题检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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