MailAddress.TryCreate 方法

定义

重载

TryCreate(String, MailAddress)

创建一个新的 MailAddress。 如果无法创建对象,则不会引发异常。

TryCreate(String, String, MailAddress)

创建一个新的 MailAddress。 如果无法创建对象,则不会引发异常。

TryCreate(String, String, Encoding, MailAddress)

创建一个新的 MailAddress。 如果无法创建对象,则不会引发异常。

TryCreate(String, MailAddress)

Source:
MailAddress.cs
Source:
MailAddress.cs
Source:
MailAddress.cs

创建一个新的 MailAddress。 如果无法创建对象,则不会引发异常。

public:
 static bool TryCreate(System::String ^ address, [Runtime::InteropServices::Out] System::Net::Mail::MailAddress ^ % result);
public static bool TryCreate (string address, out System.Net.Mail.MailAddress? result);
public static bool TryCreate (string? address, out System.Net.Mail.MailAddress? result);
static member TryCreate : string * MailAddress -> bool
Public Shared Function TryCreate (address As String, ByRef result As MailAddress) As Boolean

参数

address
String

电子邮件地址。

result
MailAddress

此方法返回时,如果分析成功,则包含电子邮件地址对象。

返回

如果成功创建了 MailAddress,则为 true;否则为 false

适用于

TryCreate(String, String, MailAddress)

Source:
MailAddress.cs
Source:
MailAddress.cs
Source:
MailAddress.cs

创建一个新的 MailAddress。 如果无法创建对象,则不会引发异常。

public:
 static bool TryCreate(System::String ^ address, System::String ^ displayName, [Runtime::InteropServices::Out] System::Net::Mail::MailAddress ^ % result);
public static bool TryCreate (string address, string? displayName, out System.Net.Mail.MailAddress? result);
public static bool TryCreate (string? address, string? displayName, out System.Net.Mail.MailAddress? result);
static member TryCreate : string * string * MailAddress -> bool
Public Shared Function TryCreate (address As String, displayName As String, ByRef result As MailAddress) As Boolean

参数

address
String

电子邮件地址。

displayName
String

与地址关联的显示名称。 此参数可以为 null

result
MailAddress

此方法返回时,如果分析成功,则包含电子邮件地址对象。

返回

如果成功创建了 MailAddress,则为 true;否则为 false

适用于

TryCreate(String, String, Encoding, MailAddress)

Source:
MailAddress.cs
Source:
MailAddress.cs
Source:
MailAddress.cs

创建一个新的 MailAddress。 如果无法创建对象,则不会引发异常。

public:
 static bool TryCreate(System::String ^ address, System::String ^ displayName, System::Text::Encoding ^ displayNameEncoding, [Runtime::InteropServices::Out] System::Net::Mail::MailAddress ^ % result);
public static bool TryCreate (string address, string? displayName, System.Text.Encoding? displayNameEncoding, out System.Net.Mail.MailAddress? result);
public static bool TryCreate (string? address, string? displayName, System.Text.Encoding? displayNameEncoding, out System.Net.Mail.MailAddress? result);
static member TryCreate : string * string * System.Text.Encoding * MailAddress -> bool
Public Shared Function TryCreate (address As String, displayName As String, displayNameEncoding As Encoding, ByRef result As MailAddress) As Boolean

参数

address
String

电子邮件地址。

displayName
String

与地址关联的显示名称。 此参数可以为 null

displayNameEncoding
Encoding

定义用于 displayName 的字符集的编码。

result
MailAddress

此方法返回时,如果分析成功,则包含电子邮件地址对象。

返回

如果成功创建了 MailAddress,则为 true;否则为 false

适用于