本文整理汇总了C#中Url.Scheme方法的典型用法代码示例。如果您正苦于以下问题:C# Url.Scheme方法的具体用法?C# Url.Scheme怎么用?C# Url.Scheme使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Url
的用法示例。
在下文中一共展示了Url.Scheme方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UrlHost3Test
public void UrlHost3Test()
{
Url url = new Url();
Assert.Equal("localhost", url.Host(urlHost3));
Assert.Equal("8080", url.Port(urlHost3));
Assert.Equal("localhost:8080", url.HostPort(urlHost3));
Assert.Equal("http", url.Scheme(urlHost3));
}
示例2: UrlSecureHost2Test
public void UrlSecureHost2Test()
{
Url url = new Url();
Assert.Equal("localhost", url.Host(urlSecureHost2));
Assert.Equal("443", url.Port(urlSecureHost2));
Assert.Equal("localhost:443", url.HostPort(urlSecureHost2));
Assert.Equal("https", url.Scheme(urlSecureHost2));
}
示例3: UrlHostPortTest
public void UrlHostPortTest()
{
Url url = new Url();
Assert.Equal("localhost.lab", url.Host(urlHostSecurePort));
Assert.Equal("6693", url.Port(urlHostSecurePort));
Assert.Equal("localhost.lab:6693", url.HostPort(urlHostSecurePort));
Assert.Equal("https", url.Scheme(urlHostSecurePort));
}
示例4: BadUrlTest
public void BadUrlTest()
{
Url url = new Url();
Assert.Equal("", url.Host("http://lajdf;/DnsService/TestService.aspx"));
Assert.Equal("", url.Port("http://lajdf:99;99/DnsService/TestService.aspx"));
Assert.Equal("", url.Scheme("ht;tp://lajdf/DnsService/TestService.aspx"));
url.UpdateUrlHost("http://localhost/DnsService/TestService.aspx", "locahost:");
}