當前位置: 首頁>>代碼示例>>C#>>正文


C# UriBuilder.Equals方法代碼示例

本文整理匯總了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 );
 }
開發者ID:LeoLcy,項目名稱:cnblogsbywojilu,代碼行數:6,代碼來源:PathHelper.cs

示例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;
        }
開發者ID:LeoLcy,項目名稱:cnblogsbywojilu,代碼行數:16,代碼來源:PathHelper.cs

示例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");
		}
開發者ID:alisci01,項目名稱:mono,代碼行數:18,代碼來源:UriBuilderTest.cs

示例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 );
        }
開發者ID:jmyd,項目名稱:oms,代碼行數:13,代碼來源:PathHelper.cs

示例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));
		}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:12,代碼來源:UriBuilderTest.cs


注:本文中的System.UriBuilder.Equals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。