Program to Check whether its a file or Directory

Discussion in 'ASP .Net' started by Stephen, Feb 15, 2006.

  1. Stephen

    Stephen Guest

    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
    Stephen, Feb 15, 2006
    #1
    1. Advertising

  2. Stephen

    Mark Rae Guest

    "Stephen" <> wrote in message
    news:%...

    > Suppose I am monitoring a Folder C:\Temp


    Monitoring? You mean with the FileSystemWatcher...?
    Mark Rae, Feb 15, 2006
    #2
    1. Advertising

  3. 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
    >
    >
    Ravi Ambros Wallau, Feb 15, 2006
    #3
  4. Stephen

    Stephen Guest

    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...?
    >
    >
    Stephen, Feb 15, 2006
    #4
  5. Stephen

    Mark Rae Guest

    "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...
    Mark Rae, Feb 15, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. eels
    Replies:
    2
    Views:
    227
    Jonas Geiregat
    Aug 23, 2005
  2. JB
    Replies:
    1
    Views:
    542
  3. thunk
    Replies:
    1
    Views:
    292
    thunk
    Mar 30, 2010
  4. thunk
    Replies:
    0
    Views:
    458
    thunk
    Apr 1, 2010
  5. thunk
    Replies:
    14
    Views:
    604
    thunk
    Apr 3, 2010
Loading...

Share This Page