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


C# CloudFile.GetFullPath方法代碼示例

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


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

示例1: StartCopyFromFile

        private void StartCopyFromFile(IStorageBlobManagement destChannel, CloudFile srcFile, string destContainerName, string destBlobName)
        {
            if (string.IsNullOrEmpty(destBlobName))
            {
                destBlobName = srcFile.GetFullPath();
            }

            CloudBlob destBlob = this.GetDestBlob(destChannel, destContainerName, destBlobName, BlobType.BlockBlob);

            this.StartCopyFromFile(destChannel, srcFile, destBlob);
        }
開發者ID:rohmano,項目名稱:azure-powershell,代碼行數:11,代碼來源:StartAzureStorageBlobCopy.cs

示例2: WriteCopyProgress

        /// <summary>
        /// Write copy progress
        /// </summary>
        /// <param name="file">CloudFile instance</param>
        /// <param name="progress">Progress record</param>
        internal void WriteCopyProgress(CloudFile file, ProgressRecord progress)
        {
            if (file.CopyState == null) return;
            long bytesCopied = file.CopyState.BytesCopied ?? 0;
            long totalBytes = file.CopyState.TotalBytes ?? 0;
            int percent = 0;

            if (totalBytes != 0)
            {
                percent = (int)(bytesCopied * 100 / totalBytes);
                progress.PercentComplete = percent;
            }

            string activity = String.Format(Resources.CopyFileStatus, file.CopyState.Status.ToString(), file.GetFullPath(), file.Share.Name, file.CopyState.Source.ToString());
            progress.Activity = activity;
            string message = String.Format(Resources.CopyPendingStatus, percent, file.CopyState.BytesCopied, file.CopyState.TotalBytes);
            progress.StatusDescription = message;
            OutputStream.WriteProgress(progress);
        }
開發者ID:docschmidt,項目名稱:azure-powershell,代碼行數:24,代碼來源:GetAzureStorageFileCopyState.cs

示例3: StartAsyncCopy

        private async Task StartAsyncCopy(long taskId, CloudFile destFile, Func<bool> checkOverwrite, Func<Task<string>> startCopy)
        {
            bool destExist = true;
            try
            {
                await destFile.FetchAttributesAsync(null, this.RequestOptions, this.OperationContext, this.CmdletCancellationToken);
            }
            catch (StorageException ex)
            {
                if (!ex.IsNotFoundException())
                {
                    throw;
                }

                destExist = false;
            }

            if (!destExist || checkOverwrite())
            {
                string copyId = await startCopy();

                this.OutputStream.WriteVerbose(taskId, String.Format(Resources.CopyDestinationBlobPending, destFile.GetFullPath(), destFile.Share.Name, copyId));
                this.OutputStream.WriteObject(taskId, destFile);
            }
        }
開發者ID:docschmidt,項目名稱:azure-powershell,代碼行數:25,代碼來源:StartAzureStorageFileCopy.cs


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