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


C# Uri.StoragePartitionName方法代碼示例

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


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

示例1: UriParser_ParsingWellFormedMinimalLocalStoragePartitionName_Succeeds

      public void UriParser_ParsingWellFormedMinimalLocalStoragePartitionName_Succeeds()
      {
         var expected = "partition";
         var url = "http://127.0.0.1:10000/account-name/partition";
         var uri = new Uri(url);

         Assert.AreEqual(expected, uri.StoragePartitionName());
      }
開發者ID:krunalnshah,項目名稱:pageofphotos,代碼行數:8,代碼來源:UriParserTests.cs

示例2: UriParser_ParsingWellFormedComplexCloudStoragePartitionName_Succeeds

      public void UriParser_ParsingWellFormedComplexCloudStoragePartitionName_Succeeds()
      {
         var expected = "partition";
         var url = "http://accountname.queue.core.windows.net/partition/somethingelse?SomeQueryStringForNow";
         var uri = new Uri(url);

         Assert.AreEqual(expected, uri.StoragePartitionName());
      }
開發者ID:krunalnshah,項目名稱:pageofphotos,代碼行數:8,代碼來源:UriParserTests.cs

示例3: GetBlobName

 public static string GetBlobName(Uri uri)
 {
    string pathAndQuery = uri.PathAndQuery; // everything to the right of domain name
    string blobNameAndQuery = pathAndQuery.Substring(uri.StoragePartitionName().Length + 2);
       // blob name is after container...
    // ... but don't include query string (if one is present) [note: query strings are ignored by Blob Storage]
    // [http://blogs.msdn.com/b/windowsazure/archive/2011/03/18/best-practices-for-the-windows-azure-content-delivery-network.aspx]
    // ["In blob storage origin, query strings are always ignored. In particular, shared access strings cannot be used to enable CDN access to a private container."]
    string blobName = blobNameAndQuery.IndexOf('?') > 0
       ? blobNameAndQuery.Substring(0, blobNameAndQuery.IndexOf('?'))
       : blobNameAndQuery;
    return blobName;
 }
開發者ID:krunalnshah,項目名稱:pageofphotos,代碼行數:13,代碼來源:ValetKeyUriValidator.cs

示例4: ContainerNameIsLongEnough

 public static bool ContainerNameIsLongEnough(Uri uri)
 {
    return uri.StoragePartitionName().Length >= MinLengthAzureBlobContainerName;
 }
開發者ID:krunalnshah,項目名稱:pageofphotos,代碼行數:4,代碼來源:ValetKeyUriValidator.cs


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