Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB7
Expertise: beginner
Mar 31, 2003

IsValidPath - Validating a system path

' Validate a system path
' Example:
'   MessageBox.Show(IsValidPath("C:\Test\Memo.txt"))         ' => True
'   MessageBox.Show(IsValidPath("\\RemotePC\Test\Memo.txt")) ' => True
'   MessageBox.Show(IsValidPath("C:\Test\Mem|o.txt"))        ' => False

Function IsValidPath(ByVal path As String) As Boolean
    Try
        Dim f As New System.IO.FileInfo(path)
        Return True
    Catch e As Exception
        Return False
    End Try
End Function
Marco Bellinaso
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap