Hello, I've created a windows service application that monitors a folder. Whenever there's a change inside the folder (like you created a text file or renamed a folder) it will log the changes. Now my problem is to determine that the change happened to a file or a folder so that in the logs, it will appear and specify that the user made a change on a file or a folder. Thanks! :)

I'm sorry if the title of the thread is confusing. It was suppose to be "How would you know if it's a file or a folder in c#?". Apologies for the confusion.

Recommended Answers

All 7 Replies

Check the type wether its a file or a folder :)

How do I check the type? :D hehehe. What class would I specifically used?

Not found IsFile or IsDirectory functions I guess then

You mean the Uri.IsFile? It still treats the directory as a file.

I can't find the IsDirectory :(

try Exists() then. theres one for each

Exists() works well. Thanks! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.