zoukankan      html  css  js  c++  java
  • WCF中的客户端

    要了解WCF中连接客户端的信息。

    需要了解OperationContext类,

    OperationContext中包括:

    IncomingMessageHeaders,

    MessageHeaders.From,类型为EndPointAddress(发送消息的节点).

    EndPointAddress 中有Headers属性。

    AddressHeader对象,地址和命名空间。

    在网上找到获得客户端IP地址的内容。

    OperationContext context = OperationContext.Current;
                MessageProperties essageProperties 
    = context.IncomingMessageProperties;
                RemoteEndpointMessageProperty endpointProperty 
    =
                messageProperties  [RemoteEndpointMessageProperty.Name]
                    
    as RemoteEndpointMessageProperty;

                
    return string.Format("Hello {0}! Your IP address is {1} and your port is {2}",  value, endpointProperty.Address, endpointProperty.Port);

  • 相关阅读:
    flash player over linux
    chmod 命令
    A*算法
    adb找不到设备
    ubuntu14.04安装wine以及国际版QQ
    linux man
    X-window
    linux file system
    linux command
    directUI
  • 原文地址:https://www.cnblogs.com/wanghualiang/p/1716694.html
Copyright © 2011-2022 走看看