ReliableSession 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 ReliableSession 類別的新執行個體。
多載
ReliableSession() |
初始化 ReliableSession 類別的新執行個體。 |
ReliableSession(ReliableSessionBindingElement) |
從可靠工作階段繫結項目,初始化 ReliableSession 類別的新執行個體。 |
ReliableSession()
初始化 ReliableSession 類別的新執行個體。
public:
ReliableSession();
public ReliableSession ();
Public Sub New ()
適用於
ReliableSession(ReliableSessionBindingElement)
從可靠工作階段繫結項目,初始化 ReliableSession 類別的新執行個體。
public:
ReliableSession(System::ServiceModel::Channels::ReliableSessionBindingElement ^ reliableSessionBindingElement);
public ReliableSession (System.ServiceModel.Channels.ReliableSessionBindingElement reliableSessionBindingElement);
new System.ServiceModel.ReliableSession : System.ServiceModel.Channels.ReliableSessionBindingElement -> System.ServiceModel.ReliableSession
Public Sub New (reliableSessionBindingElement As ReliableSessionBindingElement)
參數
- reliableSessionBindingElement
- ReliableSessionBindingElement
ReliableSessionBindingElement,使用其屬性值初始化可靠工作階段。
例外狀況
reliableSessionBindingElement
為 null
。
範例
// Create a new reliable session object
ReliableSessionBindingElement bindingElement = new ReliableSessionBindingElement();
ReliableSession reliableSession = new ReliableSession(bindingElement);
// Now you can access property values
Console.WriteLine("Ordered: {0}", reliableSession.Ordered);
Console.WriteLine("InactivityTimeout: {0}", reliableSession.InactivityTimeout);
reliableSession.Ordered = false;
Console.WriteLine("The new value for the Ordered property is: {0}", reliableSession.Ordered);
' Create a new reliable session object
Dim bindingElement As ReliableSessionBindingElement = New ReliableSessionBindingElement()
Dim reliableSession As ReliableSession = New ReliableSession(bindingElement)
' Now you can access property values
Console.WriteLine("Ordered: {0}", reliableSession.Ordered)
Console.WriteLine("InactivityTimeout: {0}", reliableSession.InactivityTimeout)
ReliableSession.Ordered = False
Console.WriteLine("The new value for the Ordered property is: {0}", ReliableSession.Ordered)