摘要:[asp.net]將一個資料夾的所有檔案複製到另外一個資料夾
首先當然要import
Imports System.IO
然後只要一行就可完成啦!!XD
Dim strTime As String = DateTime.Now.ToString("yyyyMMdd hhmmss")
Dim strFileDirPath As String = Server.MapPath("~\Temp\" & strTime & "_" & Session("UID").ToString & "_" & "ZipAndDownload")
If Not System.IO.Directory.Exists(strFileDirPath) Then
System.IO.Directory.CreateDirectory(strFileDirPath)
End If
File.Copy(Server.MapPath("~\Temp\" & strTime & "_" & Session("UID").ToString & "_" & "ZipAndDownload"), Server.MapPath("~\Temp\" & strTime & "_" & Session("UID").ToString & "_" & "ZipAndDownload"))
有相關性的文章