Csharp/C Sharp by API/System.EnterpriseServices/ApplicationAccessControl — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 12:10, 26 мая 2010
mark ApplicationAccessControl
using System;
using System.Collections.Generic;
using System.Text;
using System.EnterpriseServices;
[assembly: ApplicationName("Demo")]
[assembly: Description("C#")]
[assembly: ApplicationActivation(ActivationOption.Server)]
[assembly: ApplicationAccessControl(false)]
public interface IGreeting {
string Welcome(string name);
}
[EventTrackingEnabled(true)]
[Description("Simple Serviced Component Sample")]
public class SimpleComponent : ServicedComponent, IGreeting {
public SimpleComponent() {
}
public string Welcome(string name) {
// simulate some processing time
System.Threading.Thread.Sleep(1000);
return "Hello, " + name;
}
}
class Program {
static void Main(string[] args) {
using (SimpleComponent obj = new SimpleComponent()) {
for (int i = 0; i < 10; i++) {
Console.WriteLine(obj.Welcome("Kathie"));
}
}
}
}