4
May

Check File exists using .NET framework (VB.NET)

   Posted by: Rasik Jain   in VB.Net

Check If File Exists using VB.Net

FileInfo is a object derived from System.IO name space.

FileInfo has a property called “Exists”. This propery returns true if the file exists. False if file does not exists.

 
=========(VB.NET)===============
Imports System.IO
 
Declare Dim testfile As New FileInfo("c:\My Document\testfile.txt")
 
If testfile.Exists() Then
return true
Else
return false
End If
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • Reddit
  • HackerNews
  • Slashdot
  • StumbleUpon
  • TwitThis
  • Yahoo! Buzz
  • Tumblr
  • Share/Bookmark

Tags:

This entry was posted on Monday, May 4th, 2009 at 9:15 PM and is filed under VB.Net. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment