我试着把租期定为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分钟。
发布于 2022-07-15 13:59:30
https://stackoverflow.com/questions/72994735
复制相似问题