Program to Check whether its a file or Directory

S

Stephen

Hi all,

Suppose I am monitoring a Folder C:\Temp
and I drop either a file or directory into this folder

How will i programmatically know whether the "item" dropped is a file or a
folder

Thanks,
stephen
 
R

Ravi Ambros Wallau

System.IO.FileInfo, check Attributes property, and then test Directory
value...
 
S

Stephen

Hi Mark,

Yeah I am using FileSystemWatcher but I am trying another approach too...
Suppose you have created an exe that uses path: C:\Temp and in this folder
there are is a file or Directory, I want to see whether it a file or
directory
(just like java.io.File -> isFile, isDirectory)

Hope I am presenting my idea,

HI Ravi,
I will take a look at FileSystemInfo.Attibutes


Thanks all,
Stephen
 
M

Mark Rae

Yeah I am using FileSystemWatcher but I am trying another approach too...
Suppose you have created an exe that uses path: C:\Temp and in this folder
there are is a file or Directory, I want to see whether it a file or
directory

Oh right - Ravi has already answered this for you...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top