Uri.UriSchemeFile Field


Specifies that the URI is a pointer to a file. This field is read-only.

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

Public Shared ReadOnly UriSchemeFile As String

Field Value

Type: System.String

In .NET Framework version 1.1, a "file:///path" URI was translated to "file:/path". This has been corrected for version 2.0.

The following example creates a Uri instance and determines whether the scheme is UriSchemeFile.

Dim address2 As New Uri("file://server/filename.ext")
If address2.Scheme = Uri.UriSchemeFile Then
    Console.WriteLine("Uri is a file")
End If 

.NET Framework
Available since 1.1
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top