本文整理汇总了C#中System.UriBuilder.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# UriBuilder.Equals方法的具体用法?C# UriBuilder.Equals怎么用?C# UriBuilder.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.UriBuilder
的用法示例。
在下文中一共展示了UriBuilder.Equals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsHostSame
private static Boolean IsHostSame( String url1, String url2 )
{
String host1 = new UriBuilder( url1 ).Host;
String host2 = new UriBuilder( url2 ).Host;
return host1.Equals( host2 );
}
示例2: IsOutUrl
/// <summary>
/// �Ƿ����ⲿ����
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
public static Boolean IsOutUrl( String url )
{
Boolean isFull = IsFullUrl( url );
if (!isFull) return false;
String targetHost = new UriBuilder( url ).Host;
if (targetHost.Equals( SystemInfo.HostNoSubdomain )) return false;
if (targetHost.IndexOf( SystemInfo.HostNoSubdomain ) >= 0) return false;
return true;
}
示例3: Equals
public void Equals ()
{
b = new UriBuilder ("http://", "www.ximian.com", 80, "foo/bar/index.html?item=1");
Assert.AreEqual ("foo/bar/index.html%3Fitem=1", b.Path, "1.Path");
Assert.AreEqual ("http://www.ximian.com:80/foo/bar/index.html%3Fitem=1", b.ToString (), "1.ToString");
b2 = new UriBuilder ("http", "www.ximian.com", 80, "/foo/bar/index.html", "?item=1");
Assert.AreEqual ("http://www.ximian.com:80/foo/bar/index.html?item=1", b2.ToString (), "2.ToString");
b3 = new UriBuilder (new Uri ("http://www.ximian.com/foo/bar/index.html?item=1"));
Assert.AreEqual ("http://www.ximian.com:80/foo/bar/index.html?item=1", b3.ToString (), "3.ToString");
Assert.IsFalse (b.Equals (b2), "#1");
Assert.IsFalse (b.Uri.Equals (b2.Uri), "#2");
Assert.IsFalse (b.Equals (b3), "#3");
Assert.IsFalse (b3.Equals (b), "#4");
Assert.IsTrue (b2.Equals (b3), "#5");
}
示例4: IsOutUrl
/// <summary>
/// �Ƿ����ⲿ����
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
public static Boolean IsOutUrl( String url )
{
Boolean isFull = IsFullUrl( url );
if (!isFull) return false;
String targetHost = new UriBuilder( url ).Host;
return !targetHost.Equals( SystemInfo.Host );
}
示例5: Equals
public void Equals ()
{
b = new UriBuilder ("http://", "www.ximian.com", 80, "foo/bar/index.html?item=1");
b2 = new UriBuilder ("http", "www.ximian.com", 80, "/foo/bar/index.html", "?item=1");
b3 = new UriBuilder (new Uri ("http://www.ximian.com/foo/bar/index.html?item=1"));
Assert ("#1", b.Equals (b2));
Assert ("#2", b.Uri.Equals (b2.Uri));
Assert ("#3", b.Equals (b3));
Assert ("#4", b2.Equals (b3));
Assert ("#5", b3.Equals (b));
}