本文整理汇总了C#中System.Web.Services.Description.Port类的典型用法代码示例。如果您正苦于以下问题:C# Port类的具体用法?C# Port怎么用?C# Port使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Port类属于System.Web.Services.Description命名空间,在下文中一共展示了Port类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Port
// Create a Port.
Port postPort = new Port();
postPort.Name = "PortServiceHttpPost";
postPort.Binding = new XmlQualifiedName("s0:PortServiceHttpPost");
// Create an HttpAddressBinding.
HttpAddressBinding postAddressBinding = new HttpAddressBinding();
postAddressBinding.Location =
"http://localhost/PortClass/PortService_cs.asmx";
// Add the HttpAddressBinding to the Port.
postPort.Extensions.Add(postAddressBinding);
// Get the Service of the postPort.
Service myService = postPort.Service;
// Print the service name for the port.
Console.WriteLine("This is the service name of the postPort:*" +
myDescription.Services[0].Ports[0].Service.Name + "*");
// Add the Port to the PortCollection of the ServiceDescription.
myDescription.Services[0].Ports.Add(postPort);