我正在尝试将购买的租赁的到期时间设置为 1 分钟。这是我的代码
var shareClient = new ShareClient(connectionString, "testfileshare");
shareClient.CreateIfNotExists();
var fileClient = shareClient.GetRootDirectoryClient().GetFileClient("test.xml");
var leaseClient = fileClient.GetShareLeaseClient();
leaseClient.Acquire(TimeSpan.FromSeconds(60));
var leaseDuration = fileClient.GetProperties().Value.LeaseDuration;
通过上面的代码,leaseDuration 设置为无限。我想将其设置为 1 分钟。
最佳答案
关于azure - 如何设置 azure fileshare 租赁文件的租赁期限?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72994735/