473,466 Members | 1,314 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

File.Exists missing

In one application I have used File.Exists and in the other one it will not
let me use it. It says:

Name 'File' is not declared

Same computer, same copy of VS Studio .Net 2003, but different results....
What gives?

Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com
Sep 14 '06 #1
2 1294

Anil Gupte wrote:
In one application I have used File.Exists and in the other one it will not
let me use it. It says:

Name 'File' is not declared

Same computer, same copy of VS Studio .Net 2003, but different results....
What gives?
I think you need to have an :

Imports System.IO

to use the File Class without fully qualfying the name.

IOW, System.IO.File.Exists should work with or without the Imports.

Sep 14 '06 #2
Thanx, I added System.IO and it worked.

--
Anil Gupte
www.keeninc.net
www.icinema.com

<za***@construction-imaging.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
>
Anil Gupte wrote:
>In one application I have used File.Exists and in the other one it will
not
let me use it. It says:

Name 'File' is not declared

Same computer, same copy of VS Studio .Net 2003, but different
results....
What gives?

I think you need to have an :

Imports System.IO

to use the File Class without fully qualfying the name.

IOW, System.IO.File.Exists should work with or without the Imports.

Sep 15 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Help Needed | last post by:
There is an ASP page in my site which sometimes gives file not found error. This page which is suppossedly missing exists on the server and available most of the time. But sometimes out of the...
10
by: Kenneth McDonald | last post by:
I could've sworn python had such a command, but now I can't find it... I'm looking for an easy way to perform a UNIX-style "touch", to update the modification time of a file without actually...
5
by: reidarT | last post by:
Dim Kildefil as object Kildefil = "H:\dbBil\dbBil.mdb" if not Dir(Kildefil)) Then else Msgbox("Can't find file!",msgboxstyle.information,conMelding) end if I get this error when file is...
1
by: Tim Failes | last post by:
This seems a trival question, but I cannot get it to work properly... Essentially my question is, how can I create a text file, and guarantee it is given the current date/time as the Creation Time?...
1
by: Kyote | last post by:
I'm wanting to copy/move files from 1 directory to another in my program. I'm even doing a bit of renaming to help these specific files conform slightly to my preferred naming conventions to help...
4
by: Gabe Moothart | last post by:
Hello, In one of my asp.net applications I test the existence of a file, like so: File.Exists(Server.MapPath("/path/file.jpg"))); This was failing, even though the path returned by...
2
by: avanti | last post by:
Hi, I use ClickOnce to publish and install an application in the company. I have a help file for the same in .chm format. It is part of the C# project as a 'content' file. I also tried as...
10
by: Julia | last post by:
Hi, there, I am trying to append a binary file by using: FILE *strean; stream = fopen( "c:\temp.dat", "ba+" )); Is there a way that I can check if the file exists or not before fopen,...
26
by: Army1987 | last post by:
Is this a good way to check wheter a file already exists? #include <stdio.h> #include <stdlib.h> int ask(const char *prompt); typedef char filename; int main(int argc, char *argv) { FILE...
7
by: =?Utf-8?B?QU9UWCBTYW4gQW50b25pbw==?= | last post by:
Hi, I have been using the code (some of it has been removed for simplicity) below to allow authenticated (using ASP.NET membership database) users to get a file from their archive area. It...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.