Uri.SchemeDelimiter Fält
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Anger de tecken som skiljer kommunikationsprotokollschemat från adressdelen av URI:n. Detta fält är skrivskyddat.
public: static initonly System::String ^ SchemeDelimiter;
public static readonly string SchemeDelimiter;
staticval mutable SchemeDelimiter : string
Public Shared ReadOnly SchemeDelimiter As String
Fältvärde
Exempel
I följande exempel skapas en sträng från UriSchemeHttp, SchemeDelimiteroch en adress. En Uri instans skapas sedan från strängen.
string address = "www.contoso.com";
string uriString = String.Format("{0}{1}{2}/", Uri.UriSchemeHttp, Uri.SchemeDelimiter, address);
#if OLDMETHOD
Uri result;
if (Uri.TryParse(uriString, false, false, out result))
Console.WriteLine("{0} is a valid Uri", result.ToString());
else
Console.WriteLine("Uri not created");
#endif
Uri result = new Uri(uriString);
if (result.IsWellFormedOriginalString())
Console.WriteLine("{0} is a well formed Uri", uriString);
else
Console.WriteLine("{0} is not a well formed Uri", uriString);
let address = "www.contoso.com"
let uriString = $"{Uri.UriSchemeHttp}{Uri.SchemeDelimiter}{address}/"
#if OLDMETHOD
match Uri.TryParse(uriString, false, false) with
| true, result ->
printfn $"{result} is a valid Uri"
| _ ->
printfn "Uri not created"
#endif
let result = Uri uriString
if result.IsWellFormedOriginalString() then
printfn $"{uriString} is a well formed Uri"
else
printfn $"{uriString} is not a well formed Uri"
Dim address As String = "www.contoso.com"
Dim uriString As String = String.Format("{0}{1}{2}", Uri.UriSchemeHttp, Uri.SchemeDelimiter, address)
Dim result As Uri = New Uri(uriString)
If result.IsWellFormedOriginalString() = True Then
Console.WriteLine("{0} is a well formed Uri", uriString)
else
Console.WriteLine("{0} is not a well formed Uri", uriString)
End If