コード例 #1
0
        void UploadHtml()
        {
            CloudBlobContainer blobContainer = BlobClient.GetContainerReference("compiled");

            Parallel.ForEach(new DirectoryInfo(HtmlDir).GetFiles("*.html"), async(file) => {
                await AzureBlobUpload.UploadBlob(blobContainer.GetBlockBlobReference(file.Name), file.FullName);
            });
        }
コード例 #2
0
        void UploadPhoto()
        {
            if (String.IsNullOrEmpty(PhotosDir))
            {
                return;
            }
            CloudBlobContainer blobContainer = BlobClient.GetContainerReference("photos");

            Parallel.ForEach(new DirectoryInfo(PhotosDir).GetFiles(), async(file) => {
                await AzureBlobUpload.UploadBlob(blobContainer.GetBlockBlobReference(file.Name), file.FullName);
            });
        }
コード例 #3
0
        void UploadMetadata()
        {
            if (String.IsNullOrEmpty(SeriesJson) || String.IsNullOrEmpty(MainJson))
            {
                return;
            }
            CloudBlobContainer blobContainer = BlobClient.GetContainerReference("metadata");

            Task.WaitAll(
                AzureBlobUpload.UploadBlob(blobContainer.GetBlockBlobReference("main.json"), MainJson),
                AzureBlobUpload.UploadBlob(blobContainer.GetBlockBlobReference("series.json"), SeriesJson),
                AzureBlobUpload.UploadBlob(blobContainer.GetBlockBlobReference("rss.xml"), RssPath)
                );
        }