Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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 31-Jan-13 2:10am
Edited 31-Jan-13 2:11am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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[^]
  Permalink  
v3
Comments
SDAP_INDIA at 2-Feb-13 2:15am
   
thanks..
to alternate solution... but i have to do it as i want.
any script/command something else
aspnet_regiis -i at 4-Feb-13 3:45am
   
updated my answer..
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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[^]
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 6,212
1 OriginalGriff 5,498
2 CPallini 2,473
3 Richard MacCutchan 1,627
4 Abhinav S 1,530


Advertise | Privacy | Mobile
Web04 | 2.8.140814.1 | Last Updated 4 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100