how to check whether a file is exist and how to create new folder

dhj

Well-known member
Joined
Sep 18, 2003
Messages
82
Location
Sri Lanka
hi

How can i check whether a file is existing in a specific path from vb.net

and how to create a new folder from vb.net



thx
 
dhj said:
hi

How can i check whether a file is existing in a specific path from vb.net
Code:
If System.IO.File.Exists("C:\myFile.txt") Then
    MessageBox.Show("File Exists")
 Else
    MessageBox.Show("404 - File Not Found")
 End If

dhj said:
and how to create a new folder from vb.net
Code:
System.IO.Directory.CreateDirectory("C:\myDirectory")

dhj said:
youre welcome...

Hope this helps!

Andreas
 
Back
Top