摘要: 在做wcf时,需要得到客户端的ip。一开始用了几种方法总是不好使。后来在网上找到这个方法可以正确的获得客户端的ip了。 [OperationContract] public static string GetClientIp() { string result = String.Empty; result = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (result != null && result != String.Empty) { //可¨ 阅读全文
posted @ 2013-04-10 15:56 王洪洪 阅读(329) 评论(0) 推荐(0) 编辑