Click here to Skip to main content
15,905,325 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Getting an Exception :

C#
FileStream outputStream = new FileStream("D:\\" , FileMode.Create,FileAccess.ReadWrite,FileShare.ReadWrite);

Access to path D:\ is denied.

I have admin permissions and permission to create file then also I getting the same exception.

please help.
Posted
Updated 14-Jun-12 1:32am
v2
Comments
barneyman 14-Jun-12 7:15am    
don't you need a filename?
djrocks0101 14-Jun-12 7:31am    
oh yes ..thanks..barneyman.... :)

1 solution

It seems you are attempting to open directory, itself. "D:\\" for writing, rather than a file.
Try again with a filename, ("D:\\thisWorks.txt") and see if it works out better for you.
 
Share this answer
 
Comments
djrocks0101 14-Jun-12 7:32am    
yup..its working..thanks..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900