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


C# CloudBlob.UploadText方法代碼示例

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


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

示例1: appendToBlob

        private const string MimeTypeName = "text/plain"; // since these are assumed to

        #endregion Fields

        #region Methods

        /// <summary>
        /// ugliness of downloading and reuploading whole blob.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="toAdd"></param>
        public static void appendToBlob(CloudBlob blob, string toAdd)
        {
            string oldLogData = "";
            if (Exists(blob))
                oldLogData = blob.DownloadText();
            blob.DeleteIfExists();
            blob.UploadText(oldLogData + "\r\n" + toAdd);
        }
開發者ID:valkiria88,項目名稱:Astoria,代碼行數:19,代碼來源:BlobLibrary.cs

示例2: _handleWebException

 private bool _handleWebException(CloudBlob blob, WebException err)
 {
     var response = (HttpWebResponse)err.Response;
     if (response.StatusCode == HttpStatusCode.NotFound)
     {
         _azureDirectory.CreateContainer();
         blob.UploadText(_lockFile);
         return true;
     }
     return false;
 }
開發者ID:rhayesbite,項目名稱:Examine,代碼行數:11,代碼來源:AzureLock.cs

示例3: _handleStorageClientException

        private bool _handleStorageClientException(CloudBlob blob, StorageClientException err)
        {
            switch (err.ErrorCode)
            {
                case StorageErrorCode.ResourceNotFound:
                    blob.UploadText(_lockFile);
                    return true;

                case StorageErrorCode.ContainerNotFound:
                    // container is missing, we should create it.
                    _azureDirectory.BlobContainer.Delete();
                    _azureDirectory.CreateContainer();
                    return true;

                default:
                    return false;
            }
        }
開發者ID:rhayesbite,項目名稱:Examine,代碼行數:18,代碼來源:AzureLock.cs

示例4: SerializeNameValueCollectionToBlob

 // Serialize NameValueCollection To Blob
 private static void SerializeNameValueCollectionToBlob(NameValueCollection collection, CloudBlob blob)
 {
     try
     {
         SoapFormatter ser = new SoapFormatter();
         using (MemoryStream memoryStream = new MemoryStream())
         {
             ser.Serialize(memoryStream, collection);
             byte[] b = memoryStream.GetBuffer();
             string serilizedNameValueCollection = Encoding.Default.GetString(b);
             blob.UploadText(serilizedNameValueCollection);
         }
     }
     catch (Exception ex)
     {
         Trace.TraceError("Failed to SerializeNameValueCollectionToBlob. Error: {0}", ex.Message);
     }
 }
開發者ID:MikeOrtiz,項目名稱:dynovader,代碼行數:19,代碼來源:WindowsAzureVMManager.cs


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