FileSystemObject.CopyFile
을 사용하는 데 문제가 있습니다. 에서 제안한 것처럼FileSystemObject CopyFile : 처리되지 않은 예외
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim fso As New Scripting.FileSystemObject
Dim testfolderchk
testfolderchk = Dir("C:\Test\")
Dim inforeader As System.IO.FileInfo
Dim filedestinationcheck = Dir("C:\Test2\")
If testfolderchk <> "" Then
If Microsoft.VisualBasic.Left(testfolderchk, 4) = "test" Then
inforeader = My.Computer.FileSystem.GetFileInfo("C:\Test" & testfolderchk)
filetime = (inforeader.LastWriteTime)
If testfolderchk = filedestinationcheck Then GoTo skipfile
If testfolderchk = filedestinationcheck2 Then GoTo skipfile
Else : GoTo skipfile
End If
End If
fso.CopyFile(testfolderchk, filedestinationcheck, True)
은'시스템을 무슨 뜻인지를 보여주기 위해 나는 코드의 비트를 초안 한
: N 방법 CopyTo (String, Boolean)를 사용 .IO' 네임 스페이스는 'FileSystemObject'보다 NET 코드에 더 적합한 모든 종류의 파일 관련 메소드를 가지고 있습니다. – Plutonix
제안 사항? 누군가? – user2644085
'제안? '예, FSO를 사용하지 말고'GoTo'를 사용하지 마십시오. 그리고 약간의 연구만으로도 여기에서 파일 복사 애플릿 수백 개를 찾을 수 있습니다. – Plutonix