Copying, Moving and Deleting Files - PowerPoint PPT Presentation

1 / 4
About This Presentation
Title:

Copying, Moving and Deleting Files

Description:

Dim FileToCopy As String. Dim NewCopy As String. FileToCopy = 'C:test.txt' ... Dim FileToDelete As String. FileToDelete = 'C:testDelete.txt' ... – PowerPoint PPT presentation

Number of Views:18
Avg rating:3.0/5.0
Slides: 5
Provided by: Wag2
Category:

less

Transcript and Presenter's Notes

Title: Copying, Moving and Deleting Files


1
Copying, Moving and Deleting Files

2
Copying files
  • Dim FileToCopy As String
  • Dim NewCopy As String
  • FileToCopy "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

3
Moving files
  • Dim FileToMove As String "C\test.txt"
  • Dim MoveLocation As String "C\TestFolder\test.tx
    t"
  • If System.IO.File.Exists(FileToMove) True Then
  • System.IO.File.Move(FileToMove, MoveLocation)
  • MsgBox("File Moved")
  • End If

4
Deleting files
  • Dim FileToDelete As String
  • FileToDelete "C\testDelete.txt"
  • If System.IO.File.Exists(FileToDelete) True
    Then
  • System.IO.File.Delete(FileToDelete)
  • MsgBox("File Deleted")
  • End If
Write a Comment
User Comments (0)
About PowerShow.com