MailBindingBase.Security 屬性
取得郵件繫結的安全性物件。
命名空間: Microsoft.ServiceModel.Channels.Mail
組件: Microsoft.ServiceModel.Channels.Mail (在 Microsoft.ServiceModel.Channels.Mail.dll 中)
語法
'宣告
Public ReadOnly Property Security As MailSecurity
'用途
Dim instance As MailBindingBase
Dim value As MailSecurity
value = instance.Security
public MailSecurity Security { get; }
public:
property MailSecurity^ Security {
MailSecurity^ get ();
}
public function get Security () : MailSecurity
屬性值
型別:Microsoft.ServiceModel.Channels.Mail.MailSecurity
物件,其代表通道的安全性組態。
備註
根據預設,安全性呈停用狀態。若要啟用安全性,請使用 MailSecurity 物件的 Mode 屬性。
範例
下列範例顯示如何啟用訊息繫結的訊息安全性。如需完整的程式碼範例,請參閱 MailSecurity 類別。
Dim binding As ExchangeWebServiceMailBinding
Dim clientEmailServer As New Uri("http://mail.example.com")
Dim clientEmailAddress As String = "client@example.com"
Dim password As String = "password"
binding = New ExchangeWebServiceMailBinding(clientEmailServer, New NetworkCredential(clientEmailAddress, password))
binding.Security.Mode = MailSecurityMode.Message
ExchangeWebServiceMailBinding binding;
Uri clientEmailServer = new Uri("http://mail.example.com");
string clientEmailAddress = "client@example.com";
string password = "password";
binding = new ExchangeWebServiceMailBinding(clientEmailServer,
new NetworkCredential(clientEmailAddress, password));
binding.Security.Mode = MailSecurityMode.Message;
使用權限
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。
平台
Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Compact Framework
支援版本:3.5