Uri.UriSchemeHttp Field
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Specifies that the URI is accessed through the Hypertext Transfer Protocol (HTTP). This field is read-only.
public: static initonly System::String ^ UriSchemeHttp;
public static readonly string UriSchemeHttp;
staticval mutable UriSchemeHttp : string
Public Shared ReadOnly UriSchemeHttp As String
Field Value
Examples
The following example creates a Uri instance and determines whether the scheme is UriSchemeHttp.
Uri^ address1 = gcnew Uri( "http://www.contoso.com/index.htm#search" );
Console::WriteLine( "address 1 {0} a valid scheme name",
Uri::CheckSchemeName( address1->Scheme ) ? (String^)" has" : " does not have" );
if ( address1->Scheme == Uri::UriSchemeHttp )
{
Console::WriteLine( "Uri is HTTP type" );
}
Console::WriteLine( address1->HostNameType );
Uri address1 = new Uri("http://www.contoso.com/index.htm#search");
Console.WriteLine("address 1 {0} a valid scheme name",
Uri.CheckSchemeName(address1.Scheme) ? " has" : " does not have");
if (address1.Scheme == Uri.UriSchemeHttp)
Console.WriteLine("Uri is HTTP type");
Console.WriteLine(address1.HostNameType);
let address1 = Uri "http://www.contoso.com/index.htm#search"
printfn $"""address 1 {if Uri.CheckSchemeName address1.Scheme then " has" else " does not have"} a valid scheme name"""
if address1.Scheme = Uri.UriSchemeHttp then
printfn "Uri is HTTP type"
printfn $"{address1.HostNameType}"
Dim address1 As New Uri("http://www.contoso.com/index.htm#search")
Console.WriteLine("address 1 {0} a valid scheme name", IIf(Uri.CheckSchemeName(address1.Scheme), " has", " does not have")) 'TODO: For performance reasons this should be changed to nested IF statements
If address1.Scheme = Uri.UriSchemeHttp Then
Console.WriteLine("Uri is HTTP type")
End If
Console.WriteLine(address1.HostNameType)
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET