How can I programmatically determine if I have write privileges using C# in .Net?

.net, c#, file-permissions, networking

Solution

The simple answer would be to try it and see. The Windows security APIs are not for the faint of heart, and may be possible you have write permission without having permission to view the permissions!

Problem

How can I determine if I have write permission on a remote machine in my intranet using C# in .Net?

Original source