Check for write permisson on directory

J

Johannes Hammersen

Hi everyone,

this got to be simple, but I can't figure it out:

How can I check if I have write permisson on a folder?

Thanks
Johannes
 
J

Johannes Hammersen

Hi Eliyahu,

thanks for your reply. But I need to do this programaticly.
The problem is, our ASP.Net Application needs write permission on a certain
folders. To ensure that we have those permissions I'd like to check on
startup, and if not give the user an error message with help on how to set
the permission.

Thanks
Johannes
 
E

Eliyahu Goldin

Johannes,

If the folder is on your machine, it could be on a disk with either FAT32 or
NTFS partition. You can control security only on NTFS ones. Right-click the
folder, open the property dialog and go to Security tab.

Eliyahu
 
J

Johannes Hammersen

I was hoping there was a way to just check instead of having to create a
file, and use execeptions. But I gues I'll have to go with that.

Thanks for your help
Johannes
 
E

Eliyahu Goldin

Johannes,

I don't know how to do it programmatically. Why can't you just attempt
writing and catch exceptions? You can tell the reason for an exception by
the exception type and message.

Eliyahu
 
G

Guest

There must be some way. Google it.

Johannes Hammersen said:
I was hoping there was a way to just check instead of having to create a
file, and use execeptions. But I gues I'll have to go with that.

Thanks for your help
Johannes
 

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,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top