Exists Method

File.Exists Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Determines whether the specified file exists.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

public static bool Exists(
	string path
)

Parameters

path
Type: System.String
The file to check.

Return Value

Type: System.Boolean
true if the caller has the required permissions and path contains the name of an existing file; otherwise, false. This method also returns false if path is null, an invalid path, or a zero-length string. If the caller does not have sufficient permissions to read the specified file, no exception is thrown and the method returns false regardless of the existence of path.

Version Notes

Windows Phone

 This member has a SecurityCriticalAttribute attribute. This attribute restricts this member to internal use. Application code that uses this member throws a MethodAccessException.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2016 Microsoft