to 怎么我调用之后返回的是67?代表什么意思?public const int ERROR_BAD_NET_NAME = 67;
you can get other error messages in "www.pinvoke.net"
下面是sdk中的例子。 先使用Wmi开通连接,再Copy文件 using System; using System.Management;// This example demonstrates how to connect to remote machine // using supplied credentials. class Sample_ConnectionOptions { public static int Main(string[] args) { ConnectionOptions options = new ConnectionOptions(); options.Username = UserName; //could be in domain\user format options.Password = SecurelyStoredPassword; ManagementScope scope = new ManagementScope( "\\\\servername\\root\\cimv2", options); try { scope.Connect(); ManagementObject disk = new ManagementObject( scope, new ManagementPath("Win32_logicaldisk='c:'"), null); disk.Get(); } catch (Exception e) { Console.WriteLine("Failed to connect: " + e.Message); } return 0; } }
http://blog.csdn.net/knight94/archive/2006/03/21/631309.aspx
http://blog.csdn.net/knight94/archive/2006/03/31/645367.aspx
net use * \\dell1500-1\C$ password /user:cmic
net use f: \\IP地址\d$ "密码" /user:用户名
这样,那台电脑的D盘就映射为你的f盘了,就像本机的盘一样用了,
再用
at \\127.0.0.1 21:00 "notepad.exe"
但这个at命令,操作选程要注意用户名和密码的输入
映射到本地机器磁盘后,只要你不删除,一直在的...
请问,函数WNetAddConnection2的返回值的错误列表是什么?到哪能查到?
怎么我调用之后返回的是67?代表什么意思?
先使用Wmi开通连接,再Copy文件
using System;
using System.Management;// This example demonstrates how to connect to remote machine
// using supplied credentials.
class Sample_ConnectionOptions
{
public static int Main(string[] args) {
ConnectionOptions options = new ConnectionOptions();
options.Username = UserName; //could be in domain\user format
options.Password = SecurelyStoredPassword;
ManagementScope scope = new ManagementScope(
"\\\\servername\\root\\cimv2",
options);
try {
scope.Connect();
ManagementObject disk = new ManagementObject(
scope,
new ManagementPath("Win32_logicaldisk='c:'"),
null);
disk.Get();
}
catch (Exception e) {
Console.WriteLine("Failed to connect: " + e.Message);
}
return 0;
}
}