Dim strPathFrom, strPathTo, strGet As String
strPathFrom = "C:\Program Files\data"
strPathTo = "\\192.168.0.5\Public1\data"
' strGet = "D:\Public1\data"
Dim dir As System.IO.Directory
If Not System.IO.Directory.Exists(strPathFrom) Then
MessageBox.Show("文件不存在!", "注意", MessageBoxButtons.OK, MessageBoxIcon.Stop)
Return
End If
'拷贝文件
For Each str As String In dir.GetFiles(strPathFrom)
System.IO.File.Copy(str, strPathTo)
Next
请问naturalth:
'拷贝文件
Dim strDBArray As String = ""
For Each str As String In dir.GetFiles(strPathFrom)
'copy files
System.IO.File.Copy(str, strPathTo)
Next
以上代码的dir是什么来的?还有strGet 变量是做什么用的?
通过ftp方式进行上传的方法,能不能写个调用该方法的例子呢?uploadUrl的格式该怎么写.
谢谢!
uploadRequest.Method = WebRequestMethods.Ftp.UploadFile;
uploadRequest.Credentials = new NetworkCredential(UsrName, PassWord);
// UploadFile is not supported through an Http proxy
// so we disable the proxy for this request.
uploadRequest.Proxy = null;