关于c/s实现网络文件复制的有关问题
关于c/s实现网络文件复制的问题?
我用vb.net做c/s下的一个文件管理程序。。
要把本机指定的文件复制到服务器上,如果实现呢?
还有,怎么显示复制文件的进度呢?
------解决方案--------------------
连接到目标机器
项目,添加引用 System.Management
Imports System.Management
Dim options As New ConnectionOptions
options.Username = "administrator "
options.Password = "sa "
Dim scope As New ManagementScope( "\\computername ", options)
If Not scope.IsConnected Then
scope.Connect()
End If
Dim disk As New ManagementObject(scope, New ManagementPath( "Win32_logicaldisk= 'c: ' "), Nothing)
disk.Get()
然后就可以象操作本地文件一样了
路径用 "\\机器名\共享名 "
我用vb.net做c/s下的一个文件管理程序。。
要把本机指定的文件复制到服务器上,如果实现呢?
还有,怎么显示复制文件的进度呢?
------解决方案--------------------
连接到目标机器
项目,添加引用 System.Management
Imports System.Management
Dim options As New ConnectionOptions
options.Username = "administrator "
options.Password = "sa "
Dim scope As New ManagementScope( "\\computername ", options)
If Not scope.IsConnected Then
scope.Connect()
End If
Dim disk As New ManagementObject(scope, New ManagementPath( "Win32_logicaldisk= 'c: ' "), Nothing)
disk.Get()
然后就可以象操作本地文件一样了
路径用 "\\机器名\共享名 "