有妻嫣然,星布里,香濡饮
//onopen事件
protected override void onopen() { string ipaddress = base.sessions.sessions.first().context.userendpoint.tostring();
string ipaddress2 = base.context.userendpoint.tostring(); websocketmain.account++; base.onopen(); }
在onopen事件内,通过
base.sessions.sessions.first().context.userendpoint.tostring();
string ipaddress2 = base.context.userendpoint.tostring();
函数以上两个函数都可以获取到客户端的ip地址及端口号
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Blazor server side 自家的一些开源的, 实用型项目的进度之 CEF客户端
.NET IoC模式依赖反转(DIP)、控制反转(Ioc)、依赖注入(DI)
vue+.netcore可支持业务代码扩展的开发框架 VOL.Vue 2.0版本发布
网友评论