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
 
Ad

Advertisements

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
 
Ad

Advertisements

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...
 

Top