Forgot your password?
Sign in with
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View Python questions
View C++ questions
View Java questions
All Message Boards...
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Design and Architecture
Internet of Things
C / C++ / MFC
ATL / WTL / STL
Objective-C and Swift
Hardware & Devices
Hosting and Servers
.NET (Core and Framework)
Site Bugs / Suggestions
Spam and Abuse Watch
The Insider Newsletter
The Daily Build Newsletter
Most Valuable Professionals
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
What is 'CodeProject'?
Ask a Question
Bugs and Suggestions
Article Help Forum
Comments by Member 7979150 (Top 6 by date)
I need to transfer folder which include multiple files and this folder size may be 30 MB or more.I cannot give url because i need to transfer foldrer on client machine silently and could you please explain me how can i use this url.
could you please tell me if you any other solution to do like u said using .net. please help me.
I mean file and printer sharing for microsoft networks(network protocol) unchecked on client m/c then server cannot access client machine it will show error "network path not found". even if i access client m/c through run from server it will show same error which it shows through code. Please give me solution. I will be grateful for this. It's very urgent and iam stuck in this more than 10 days. please .............. help me.
Thanks for reply.
if file and printer sharing for microsoft network(network protocol) is unchecked then in that case i cannot access client machine otherwise it is accessible.
please find my code below:-
public void CreateDir(string DriverPath)
IntPtr token = IntPtr.Zero;
WindowsImpersonationContext impersonatedUser = null;
Hashtable Fod_Files = new Hashtable();
// Create a token for DomainName\UserName
//Call LogonUser function to obtain an access token
// for the specified user
client_Uname = "a1093557";
// client_IPAddress = "india.airtel.itm";
client_pwd = "sairam@9";
DomainName = "india.airtel.itm";
bool result = LogonUser(client_Uname, DomainName,
//create a new window identity from the window access token
WindowsIdentity id = new WindowsIdentity(token);
// Begin impersonation
impersonatedUser = id.Impersonate();
Drv_FolderPath = @"C:\PrntDriver1";
DriverPath = @"\\10.14.65.85\C$\hp";
// Drv_FolderPath = @"\\" + client_IPAddress + @"\C$\PrntDriver";
Fod_Files = Chk_Files(DriverPath);
string FileName = null;
string Drv_Fold = null;
Drv_Fold = DriverPath.Split('\\');
int i = Drv_Fold.Length;
//loop on hashtable which contains all the file with their path
foreach (string f in Fod_Files.Values)
FileName = f.Split('\\');
string Dest_Path = Drv_FolderPath + @"\" + FileName[i];
//it will copy files on client machine
// utl.putLogData(DateTime.Now.ToString() + " Driver setup copied successfully ");
// if the LogonUser return code is zero,an error has occured
// utl.putLogData("</p>LogonUser failed: " +
//Response.Write("</p>LogonUser failed: " +
catch (Exception ex)
// Stop impersonation and revert to the process identity
if (impersonatedUser != null)
//// Free the token
if (token != IntPtr.Zero)
Thank you so much for reply.
I have permissions to create folder on client machine because i have domain id who have administrator rights on domain. using that id i can do anything on those client machine which are on domain. That's why above mentioned code run successfully if i manually checked the protocol "file and printer sharing for microsoft networks"(network protocol). But when i uncheck this checkbox then it will give me error "network path not found" because i cannot even access that machine by typing its ip address in run command.you tell me i need to go through network protocols could you please tell me how can i do this. If you provide me code for this then it's really a great help for me.
I cannot create client side application.I have to achieve this target using web application.Could you please tell me how to give permissions to server app so that i can create folder on client side. My above solution is working fine if file and printer sharing for microsoft networks checkbox is checked. But when client machine is on domain then due to policies this network protocol is unchecked due to which my above mentioned code fail and give me error "network path not found". If anybody have any idea how to check/uncheck file and printer sharing for microsoft networks on client machine using web application then please help me. I also try to enable file and printer sharing for microsoft network using vb script but that's also not working. Do you any solution using which i can transfer folder on different clients machine using asp.net web application. Please help . It's urgent. I am stuck in this problem more than a week but still not find any solution.
Last Updated 1 Jan 1900
All Rights Reserved.