Copy and Delete Files using VB .Net.
Environment:
Visual Studio 2005
Visual Basic
Visual Basic
Header:
Imports System
Imports System.IO
Copy
Function:
File.Copy(SourceFile, DestinationFile)
Example :
File.Copy("C:\test.txt", "C:\test.txt")
Delete
Function:
File.Delete(DestinationFile)
Example :
File.Delete("C:\test.txt")
Example Coding
Dim FileToCopy As String
Dim NewCopy As StringFileToCopy = "C:\test.txt"
NewCopy = "C:\NewTest.txt"If System.IO.File.Exists(FileToCopy) = True Then
System.IO.File.Copy(FileToCopy, NewCopy)
MsgBox("File Copied")
End If
No comments:
Post a Comment