如何运行code在WCF服务的构造函数只有一次当的 ServiceBehaviorAttribute.InstanceContextMode
设置为 PerSession
?
How can I run the code in the constructor of a WCF Service only once when the ServiceBehaviorAttribute.InstanceContextMode
is set to PerSession
?
[ServiceBehavior(
InstanceContextMode = InstanceContextMode.PerSession,
ConcurrencyMode = ConcurrencyMode.Single)]
public class SomeService : ISomeService
{
public SomeService()
{
this.RunThisOnceForAllClients();
}
private void RunThisOnceForAllClients() { }
}
或者,我怎么能在运行后自动WCF服务的方法运行,但它的只是将所有客户端上运行,一旦调用
请帮忙。先谢谢了。
我用href="http://msdn.microsoft.com/en-us/library/ms733069.aspx" rel="nofollow">托管Windows服务一个
上一篇:我如何给Android应用的Widget一个标签/名称名称、标签、Android、Widget
下一篇:BitmapFactory.de codeResource返回空值BitmapFactory、de、codeResource