远程服务器返回错误:(404)Not Found ..如何解决此问题...
public object Delete(string name)
{
dynamic deleted = true;
try
{
CloudBlobClient blobClient = SMBS.GetBlobContainer();
CloudBlobContainer blobContainer = blobClient.GetContainerReference("container1");
CloudBlockBlob blockBlob = blobContainer.GetBlockBlobReference(name);
blockBlob.Delete();
}
catch (Exception ex)
{
deleted = false;
}
return deleted;
}
答案 0 :(得分:4)
实际上可能丢失了blob,或者您的请求可能未经过身份验证。请查看凭据是否正确。此外,您可以使用Azure Storage Client Library中的ICloudBlob.DeleteIfExists方法代替Delete方法。