Share via


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ShareClient.CreateIfNotExistsAsync 方法

定义

重载

CreateIfNotExistsAsync(IDictionary<String,String>, Nullable<Int32>, CancellationToken)

CreateIfNotExistsAsync(IDictionary<String,String>, Nullable<Int32>, CancellationToken)操作在指定帐户下创建一个新共享。 如果已存在同名的共享,则不会更改该共享。

有关详细信息,请参阅 创建共享

CreateIfNotExistsAsync(ShareCreateOptions, CancellationToken)

CreateIfNotExistsAsync(IDictionary<String,String>, Nullable<Int32>, CancellationToken)操作在指定帐户下创建一个新共享。 如果已存在同名的共享,则不会更改该共享。

有关详细信息,请参阅 创建共享

CreateIfNotExistsAsync(IDictionary<String,String>, Nullable<Int32>, CancellationToken)

Source:
ShareClient.cs
Source:
ShareClient.cs

CreateIfNotExistsAsync(IDictionary<String,String>, Nullable<Int32>, CancellationToken)操作在指定帐户下创建一个新共享。 如果已存在同名的共享,则不会更改该共享。

有关详细信息,请参阅 创建共享

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.ShareInfo>> CreateIfNotExistsAsync (System.Collections.Generic.IDictionary<string,string> metadata = default, int? quotaInGB = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateIfNotExistsAsync : System.Collections.Generic.IDictionary<string, string> * Nullable<int> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.ShareInfo>>
override this.CreateIfNotExistsAsync : System.Collections.Generic.IDictionary<string, string> * Nullable<int> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.ShareInfo>>
Public Overridable Function CreateIfNotExistsAsync (Optional metadata As IDictionary(Of String, String) = Nothing, Optional quotaInGB As Nullable(Of Integer) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of ShareInfo))

参数

metadata
IDictionary<String,String>

要为此共享设置的可选自定义元数据。

quotaInGB
Nullable<Int32>

可选。 共享的最大大小(以字节为单位)。 如果未指定,请使用服务的默认值。

cancellationToken
CancellationToken

可选 CancellationToken ,用于传播应取消操作的通知。

返回

描述 Response<T> 新创建的共享的 。 如果共享已存在,则为 null

注解

RequestFailedException如果发生故障,将引发 。

适用于

CreateIfNotExistsAsync(ShareCreateOptions, CancellationToken)

Source:
ShareClient.cs
Source:
ShareClient.cs

CreateIfNotExistsAsync(IDictionary<String,String>, Nullable<Int32>, CancellationToken)操作在指定帐户下创建一个新共享。 如果已存在同名的共享,则不会更改该共享。

有关详细信息,请参阅 创建共享

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.ShareInfo>> CreateIfNotExistsAsync (Azure.Storage.Files.Shares.Models.ShareCreateOptions options, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateIfNotExistsAsync : Azure.Storage.Files.Shares.Models.ShareCreateOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.ShareInfo>>
override this.CreateIfNotExistsAsync : Azure.Storage.Files.Shares.Models.ShareCreateOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.ShareInfo>>
Public Overridable Function CreateIfNotExistsAsync (options As ShareCreateOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of ShareInfo))

参数

options
ShareCreateOptions

可选参数。

cancellationToken
CancellationToken

可选 CancellationToken ,用于传播应取消操作的通知。

返回

描述 Response<T> 新创建的共享的 。 如果共享已存在,则为 null

注解

RequestFailedException如果发生故障,将引发 。

适用于