File.Exists Method

   
File.Exists Method

Class

System.IO.File

Syntax

 File.Exists(   path   ) 
path (required; String)

The file path

Return Value

A Boolean indicating whether the file exists

Description

Indicates whether a file exists

Rules at a Glance

  • path is a fully qualified filename or a relative path (which is interpreted as starting in the current directory).

  • The Exists method returns True only if the specified file exists; otherwise , it returns False . Note that Exists returns False if path describes a directory instead of a folder.

Programming Tips and Gotchas

Since the File class is shared, you don't have to instantiate any objects before calling the File.Exists method.

See Also

Directory.Exists Method

   


VB.Net Language in a Nutshell
VB.NET Language in a Nutshell
ISBN: B00006L54Q
EAN: N/A
Year: 2002
Pages: 503

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net