我只是想知道是否有办法让常规的Windows按钮在java中工作。对我来说,JButton看起来不太专业,AWT Buttons看起来很老,所以我只是想知道是否还有使用它们?如果没有,你可以把我送到一个允许我使用的外部API,如果有的话。
答案 0 :(得分:1)
var azureStorageConnectionString = ConfigurationManager.AppSettings["AzureStorage.ConnectionString"];
var blobFileToDelete= ConfigurationManager.AppSettings["BlobFileToDelete.Name"];
var account = CloudStorageAccount.Parse(azureStorageConnectionString);
// Create the blob client using the Accounts above
var client = account.CreateCloudBlobClient();
// Retrieve reference to a previously created container
// Rename "vhds" as needed. Can be used to read from any container.
var container = client.GetContainerReference("vhds");
var blob = container.GetBlockBlobReference(blobFileToDelete);
if (blob.Properties.LeaseStatus==Microsoft.WindowsAzure.Storage.Blob.LeaseStatus.Locked)
{
try
{
Console.WriteLine("Breaking leases on {0} blob.",blobFileToDelete);
// Create Timespan to allow the Lease to remain, in this case 1 second
TimeSpan breakTime = new TimeSpan(0, 0, 1);
blob.BreakLease(breakTime, null, null, null);
Console.WriteLine("Successfully broken lease on {0} blob.",blobFileToDelete);
}
catch (StorageException ex )
{
Console.WriteLine(ex.Message);
Console.WriteLine("Failed to break lease on {blobName} blob.", blobFileToDelete);
}
}
else
{
Console.WriteLine("The {0} blob's lease status is unlocked.", blobFileToDelete);
}
Console.ReadLine();