Click here to Skip to main content
15,885,839 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

Actually i m working on application which copy a folder from my pc to (another server)(both on network), for that i have to manually access that pc by passsing login credentials. is there any way to write code in c# (v 2.0) by passing network credential and when i run it should be auto access and copy folders on that server.

kindly suggest.
Posted
Updated 31-Jan-13 2:11am
v2

You can create a shared folder on the server and apply the read-write permissions to your windows account.

http://www.techrepublic.com/blog/window-on-windows/how-do-i-share-folders-in-windows-7-with-the-shared-folder-wizard/3180[^]

Edit - 4 Feb-13
Once you create shared folder on another machine. You can using C# File classes to copy the files\folders from the application.
http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/faf174a4-dbd6-4aab-a8dc-6d52a8b2ac3b[^]
 
Share this answer
 
v3
Comments
SDAP_INDIA 2-Feb-13 2:15am    
thanks..
to alternate solution... but i have to do it as i want.
any script/command something else
bbirajdar 4-Feb-13 3:45am    
updated my answer..
You can use impersonation for this. You can define it in the config file or you can add that in the code whatever you like.

http://stackoverflow.com/questions/125341/how-do-you-do-impersonation-in-net[^]
 
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