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