本文整理匯總了C#中System.ServiceModel.Description.ServiceDescription.GetService方法的典型用法代碼示例。如果您正苦於以下問題:C# ServiceDescription.GetService方法的具體用法?C# ServiceDescription.GetService怎麽用?C# ServiceDescription.GetService使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.ServiceModel.Description.ServiceDescription
的用法示例。
在下文中一共展示了ServiceDescription.GetService方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CalculatorService
// Instantiate a service description specifying a service object
// Note: Endpoints collection and other properties will be null since
// we have not specified them
CalculatorService svcObj = new CalculatorService();
ServiceDescription sd3 = ServiceDescription.GetService(svcObj);
String serviceName = sd3.Name;
Console.WriteLine("Service name: {0}", serviceName);
示例2:
ServiceDescription d = ServiceDescription.GetService(typeof(CalculatorService));
foreach (IServiceBehavior isb in d.Behaviors)
{
Console.WriteLine(isb.GetType());
}
Console.WriteLine();
示例3: CalculatorService
ServiceDescription d = ServiceDescription.GetService(new CalculatorService());
foreach (IServiceBehavior isb in d.Behaviors)
{
Console.WriteLine(isb.GetType());
}
Console.WriteLine();