Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to create a folder and copy a file in server machine? I would like to create a folder in a server machine. I got a new user for this with password. How to create a folder programmatically and copy a file to it. I have tried with



Directory.CreateDirectory(path)


I am getting the attached documents from outlook and saving it to network drive. It works fine when it is saved in local drive. But it fails when saving it in network drive. Also I have a new user account created with full rights to the network path.


But it says : System.IO.IOException: Logon failure: unknown user name or bad password. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, DirectorySecurity dirSecurity)
Posted
Updated 19-Jul-12 3:19am
v2

1 solution

Your User must have access to the target machine and must be authenticated first before running the above code.

Read the following :
http://stackoverflow.com/questions/4154431/authenticating-user-to-create-directory-in-c-sharp[^]
 
Share this answer
 

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