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 ^ binding);
public ReliableSession (System.ServiceModel.Channels.ReliableSessionBindingElement reliableSessionBindingElement);
public ReliableSession (System.ServiceModel.Channels.ReliableSessionBindingElement binding);
new System.ServiceModel.ReliableSession : System.ServiceModel.Channels.ReliableSessionBindingElement -> System.ServiceModel.ReliableSession
new System.ServiceModel.ReliableSession : System.ServiceModel.Channels.ReliableSessionBindingElement -> System.ServiceModel.ReliableSession
Public Sub New (reliableSessionBindingElement As ReliableSessionBindingElement)
Public Sub New (binding As ReliableSessionBindingElement)
参数
- reliableSessionBindingElementbinding
- 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)