当前位置: 首页>>代码示例>>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;未经允许,请勿转载。