Aws.AzureTools.BlobHelper.DeleteBlob C# (CSharp) Метод

DeleteBlob() публичный Метод

public DeleteBlob ( string containerName, string blobName ) : void
containerName string
blobName string
Результат void
        public void DeleteBlob(string containerName, string blobName)
        {
            CloudBlobContainer container = cloudBlobClient.GetContainerReference(containerName);
            ICloudBlob blob = container.GetBlobReferenceFromServer(blobName);

            blob.Delete();
        }

Usage Example

Пример #1
0
        static int Main(string[] args)
        {
            if (args.Length != 1)
            {
                string usage = "Usage: DeleteBlob container/blob";
                Trace.TraceInformation(usage);
                Console.WriteLine(usage);
                return (Settings.SUCCESS);
            }

            string blobPath = args[0];

            string[] fields = blobPath.Split('/');
            string containerName = fields[0];
            string blobName = fields[1];

            BlobHelper blobHelper = new BlobHelper();
            blobHelper.DeleteBlob(containerName, blobName);

            return (Settings.SUCCESS);
        }