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

Home Posts Topics Members FAQ

Existsing of File

Hi EveryBody:

How can I check if the file created by me exists or not?

any help will be appreciated

regard's

Husam
Nov 21 '05 #1
7 913
Husam,
System.IO.File.Exists()

Jason Newell, MCAD
Software Engineer

Husam wrote:
Hi EveryBody:

How can I check if the file created by me exists or not?

any help will be appreciated

regard's

Husam

Nov 21 '05 #2
"Husam" <Hu***@discussions.microsoft.com> schrieb:
How can I check if the file created by me exists or not?


'System.IO.File.Exists'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #3
System.IO.File.Exists

http://msdn.microsoft.com/library/en...xiststopic.asp

HTH
rawCoder
"Husam" <Hu***@discussions.microsoft.com> wrote in message
news:6F**********************************@microsof t.com...
Hi EveryBody:

How can I check if the file created by me exists or not?

any help will be appreciated

regard's

Husam

Nov 21 '05 #4
Select Case File.Exists(MyFileName)
Case True
'if the file does not exist, then creating (or whatever)
Case False
'if it DOES exist, do nothing.. (or whatever)
End Select

--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #5
"Chris Murphy via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in
message news:78******************************@DotNetMonste r.com...
Select Case File.Exists(MyFileName)
Case True
'if the file does not exist, then creating (or whatever)
Case False
'if it DOES exist, do nothing.. (or whatever)
End Select


Why would you choose to use "Select Case" when File.Exists()
returns a Boolean?

Regards,
Phill W.
Nov 21 '05 #6
Hi EveryBody:

I just really want to thank all of you for your quik and helpfull replayment

regard's

Husam

"Jason Newell" wrote:
Husam,
System.IO.File.Exists()

Jason Newell, MCAD
Software Engineer

Husam wrote:
Hi EveryBody:

How can I check if the file created by me exists or not?

any help will be appreciated

regard's

Husam

Nov 21 '05 #7
"Chris Murphy via DotNetMonster.com" <fo***@DotNetMonster.com> schrieb:
Select Case File.Exists(MyFileName)
Case True
'if the file does not exist, then creating (or whatever)
Case False
'if it DOES exist, do nothing.. (or whatever)
End Select


I prefer 'If...Then':

\\\
If File.Exists(...) Then
...
Else
...
End If
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #8

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

Similar topics

2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
7
by: Joseph | last post by:
Hi, I'm having bit of questions on recursive pointer. I have following code that supports upto 8K files but when i do a file like 12K i get a segment fault. I Know it is in this line of code. ...
3
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
1
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
3
by: Shapper | last post by:
Hello, I created a script to upload a file. To determine the file type I am using userPostedFile.ContentType. For example, for a png image I get "image/png". My questions are: 1. Where can...
0
by: troutbum | last post by:
I am experiencing problems when one user has a document open through a share pointing to the web site. I use the dsolefile to read the contents of a particular directory and then display them in a...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
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 ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.