Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Program to Check whether its a file or Directory

Reply
Thread Tools

Program to Check whether its a file or Directory

 
 
Stephen
Guest
Posts: n/a
 
      02-15-2006
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


 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      02-15-2006
"Stephen" <> wrote in message
news:%...

> Suppose I am monitoring a Folder C:\Temp


Monitoring? You mean with the FileSystemWatcher...?


 
Reply With Quote
 
 
 
 
Ravi Ambros Wallau
Guest
Posts: n/a
 
      02-15-2006
System.IO.FileInfo, check Attributes property, and then test Directory
value...

"Stephen" <> wrote in message
news:%...
> 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
>
>



 
Reply With Quote
 
Stephen
Guest
Posts: n/a
 
      02-15-2006
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


"Mark Rae" <> wrote in message
news:O5y%...
> "Stephen" <> wrote in message
> news:%...
>
> > Suppose I am monitoring a Folder C:\Temp

>
> Monitoring? You mean with the FileSystemWatcher...?
>
>



 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      02-15-2006
"Stephen" <> wrote in message
news:...

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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Its a bird, its a plane, its.. um, an Attribute based System? thunk Ruby 14 04-03-2010 10:08 AM
Its a bird, its a plane, its.. um, an Attribute based System? thunk Ruby 0 04-01-2010 10:25 PM
Its a bird, its a plane, no ummm, its a Ruide thunk Ruby 1 03-30-2010 11:10 AM
How to check whether user put a check in a toolbox CheckBox contro JB ASP .Net 1 08-26-2009 11:18 PM
check whether directory is readable eels Python 2 08-23-2005 01:34 PM



Advertisments