WCF 获取客户端IP
2024-08-24 03:01:45
public class Service2 : IService2
{
public User DoWork()
{
Console.WriteLine(ClientIpAndPort());
return new User { Name = "sdf", Age = };
}
public string ClientIpAndPort()
{
OperationContext context = OperationContext.Current;
MessageProperties properties = context.IncomingMessageProperties;
RemoteEndpointMessageProperty endpoint = properties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty; return endpoint.Address+"port"+endpoint.Port;
}
}
最新文章
- 【leetcode】Palindrome Number
- vs运行时候冒了这个错:无法启动IIS Express Web 服务器~Win10
- URI和URL、URN区别
- Visual Studio 拓展插件——Image Optimizer
- Enum:Backward Digit Sums(POJ 3187)
- Django.template框架 template context (非常详细)
- 使用AS3.0代码实现给图片添加滤镜的模糊与斜角效果
- pyqt4制作透明无边框窗体
- Math.round(11.5)等于()Math.round(-11.5)等于()
- Week11(11月19日):补课
- Quick Cocos2dx CCLuaStack has no member names 'loadChunksZip'
- IOC 的理解与解释
- luogu5020 [NOIp2018]货币系统 (完全背包)
- FS G729转码测试记录
- 基于TerraExplorer Pro 6.1 实现对Shape中Feature对象拾取查询
- Python3科学计算库概况
- siblings()
- Hammer.js 实现移动端元素的拖拽库
- iOS 出现错误reason: image not found的解决方案
- Xcode And iOS9新特性
热门文章
- NODE-WEBKIT教程(5)NATIVE UI API 之FRAMELESS WINDOW
- C#为什么不能像C/C++一样的支持函数只读传参
- 使用 xUnit 编写 ASP.NET Core WebAPI单元测试
- .net core 分布式配置中心
- 【BZOJ4827】 [Hnoi2017]礼物
- 201621123018《Java程序设计》第5周学习报告
- Android------------------的快捷键的使用
- Java并发编程总结5——ThreadPoolExecutor
- pringboot+mybatis+redis+cookie单点登录
- while循环中使用scanf函数