我爱我老婆

WCF常用取值方法

取客户端的IP地址:

var remote = System.ServiceModel.OperationContext.Current.IncomingMessageProperties[System.ServiceModel.Channels.RemoteEndpointMessageProperty.Name] as System.ServiceModel.Channels.RemoteEndpointMessageProperty;
var ip = remote.Address;

 

取请求流长度:

System.ServiceModel.Web.WebOperationContext.Current.IncomingRequest.ContentLength

posted @ 2011-07-05 16:41  DataFlow  阅读(235)  评论(0编辑  收藏  举报