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


C# Uri.AppendPath方法代碼示例

本文整理匯總了C#中System.Uri.AppendPath方法的典型用法代碼示例。如果您正苦於以下問題:C# Uri.AppendPath方法的具體用法?C# Uri.AppendPath怎麽用?C# Uri.AppendPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Uri的用法示例。


在下文中一共展示了Uri.AppendPath方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: EtcdClient

 public EtcdClient(Uri etcdLocation)
 {
     var uriBuilder = new UriBuilder(etcdLocation)
     {
        Path = ""
     };
     _root = uriBuilder.Uri;
     _keysRoot = _root.AppendPath("v2").AppendPath("keys");
     _client = new RestClient(_root.ToString());
 }
開發者ID:haf,項目名稱:etcetera,代碼行數:10,代碼來源:EtcdClient.cs

示例2: AppendRelativeURLString

 private static string AppendRelativeURLString(Uri remote, string relativePath)
 {
     var uri = remote.AppendPath(relativePath);
     return uri.AbsoluteUri;
 }
開發者ID:ertrupti9,項目名稱:couchbase-lite-net,代碼行數:5,代碼來源:BulkDownloader.cs

示例3: TestAppendPathURLString

        public virtual void TestAppendPathURLString([Values("http://10.0.0.3:4984/connect-2014", "http://10.0.0.3:4984/connect-2014/")] String baseUri, [Values("/_bulk_get?revs=true&attachments=true", "_bulk_get?revs=true&attachments=true")] String newPath)
        {
            if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
            {
                Assert.Inconclusive("Replication tests disabled.");
                return;
            }

            var dbUrlString = new Uri(baseUri);
            var relativeUrlString = dbUrlString.AppendPath(newPath).AbsoluteUri;
            var expected = "http://10.0.0.3:4984/connect-2014/_bulk_get?revs=true&attachments=true";
            Assert.AreEqual(expected, relativeUrlString);
        }
開發者ID:jonfunkhouser,項目名稱:couchbase-lite-net,代碼行數:13,代碼來源:ReplicationTest.cs

示例4: AppendRelativeURLString

        private static string AppendRelativeURLString(Uri remote, string relativePath)
        {
            var uri = remote.AppendPath(relativePath);
            return uri.AbsoluteUri;
            // the following code is a band-aid for a system problem in the codebase
            // where it is appending "relative paths" that start with a slash, eg:
            //     http://dotcom/db/ + /relpart == http://dotcom/db/relpart
            // which is not compatible with the way the java url concatonation works.
//            var remoteUrlString = remote.AbsolutePath;
//            if (remoteUrlString.EndsWith ("/", StringComparison.Ordinal) 
//                && relativePath.StartsWith ("/", StringComparison.Ordinal))
//            {
//                remoteUrlString = remoteUrlString.Substring(0, remoteUrlString.Length - 1);
//            }
//            return remoteUrlString + relativePath;
        }
開發者ID:FireflyLogic,項目名稱:couchbase-lite-net,代碼行數:16,代碼來源:BulkDownloader.cs


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