语言

Uri.UriSchemeFile 字段

定义

指定 URI 是指向文件的指针。 此字段是只读的。

public: static initonly System::String ^ UriSchemeFile;
public static readonly string UriSchemeFile;
 staticval mutable UriSchemeFile : string
Public Shared ReadOnly UriSchemeFile As String 

字段值

示例

以下示例创建一个 Uri 实例,并确定方案是否为 UriSchemeFile。

Uri address2 =  new Uri("file://server/filename.ext");
if (address2.Scheme == Uri.UriSchemeFile)
    Console.WriteLine("Uri is a file");
let address2 = Uri "file://server/filename.ext"
if address2.Scheme = Uri.UriSchemeFile then
    printfn "Uri is a file"
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 版本 1.1 中,“file:///path”URI 已转换为“file:/path”。 已更正版本 2.0。

适用于