共用方式為


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 = gcnew Uri( "file://server/filename.ext" );
if ( address2->Scheme == Uri::UriSchemeFile )
{
   Console::WriteLine( "Uri is a file" );
}
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 版進行更正。

適用於