Uri.UriSchemeFile Uri.UriSchemeFile Uri.UriSchemeFile Uri.UriSchemeFile Field

定义

指定 URI 是指向文件的指针。Specifies that the URI is a pointer to a file. 此字段为只读。This field is read-only.

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

字段值

示例

下面的示例创建Uri实例,并确定是否为方案UriSchemeFileThe following example creates a Uri instance and determines whether the scheme is 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");
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"。In .NET Framework version 1.1, a "file:///path" URI was translated to "file:/path". 已为版本 2.0 已更正此问题。This has been corrected for version 2.0.

适用于