Hi,
I want to copy files from my local disk to server or from server to my
local disk.
public struct NETRESOURCE
{
public int dwScope;
public int dwType;
public int dwDisplayType;
public int dwUsage;
public string lpLocalName;
public string lpRemoteName;
public string lpComment;
public string lpProvider;
};
[DllImport("mpr.dll", EntryPoint="WNetAddConnection2")]
public static extern int WNetAddConnection2A(
ref NETRESOURCE lpNetResource,
string lpPassword,
string lpUserName,
int dwFlags);
In codes:
string szPwd = "test";
string szUser = "administrator";
NETRESOURCE netRes = new NETReSOURCE();
netRes.lpRemoteName = "\\server\c$"
....
int errInfo = WNetAddConnection2A(ref netRes,szPwd,szUser,CONNECT_UPDATE_PROFILE);
....
why return errorInfo is not find share resource?
how to connnect the default share resouce ?
thanks!
best wish,
harvie
2006-4-23