classProgram
{static void Main(string[] args)
{bool status = false;//连接共享文件夹
status = connectState(@"\\10.200.8.73\share", "administrator", "11111111");if(status)
{//共享文件夹的目录
DirectoryInfo theFolder = new DirectoryInfo(@"\\10.200.8.73\share");//相对共享文件夹的路径
string fielpath=@"\123\456\";//获取保存文件的路径
string filename = theFolder.ToString() +fielpath ;//执行方法
Transport(@"D:\1.jpg", filename, "1.jpg");
}else{//ListBox1.Items.Add("未能连接!");
}
Console.ReadKey();
}public static bool connectState(stringpath)
{return connectState(path, "", "");
}///
///连接远程共享文件夹///
/// 远程共享文件夹的路径
/// 用户名
/// 密码
///
public static bool connectState(string path, string userName, st