簡體   English   中英

如何從同一網絡中的IP地址獲取活動用戶

[英]how to get active user from ip address in same network

我有網絡IP地址我可以根據特定的IP地址了解活動用戶

我有同一網絡的詳細信息

        "host"+"-" + new Program().GetHostName(ip[0].ToString()).ToString() + "<br>" +
    "KeepAlive" + request.KeepAlive + "<br>" +
    "Local end point: {0}" + "-" + request.LocalEndPoint.ToString() + "<br>" +
    "Remote end point: {0}" + "-" + "--" + "<br>" +
    "Is local? {0}" + "-" + request.IsLocal + "<br>" +
    "HTTP method: {0}" + "-" + request.HttpMethod + "<br>" +
    "Protocol version: {0}" + "-" + request.ProtocolVersion + "<br>" +
    "Is authenticated: {0}" + "-" + request.IsAuthenticated + "<br>" +
    "Is secure: {0}" + "<br>" + request.IsSecureConnection + "<br>" +
    //"username " + "-"+ username + "<br>"+

我假設你在這里使用HttpListener / HttpRequestListener,如果是這樣,請參閱HttpListener:如何獲取http用戶和密碼? - 接受的答案涉及基本身份驗證,但它鏈接到詳細說明如何請求Windows身份驗證的文章,因此客戶端應該將登錄的Windows用戶名引用到您的應用程序。

Ps:看起來你正在創建一個日志? 那個字符串concat代碼有點混亂,可以通過整理來獲益,也許使用插值字符串:

    $@"Host: {new Program().GetHostName(ip[0].ToString())}<br/>
KeepAlive: {request.KeepAlive}<br/>
Local end point: {request.LocalEndPoint}<br/>
... and so on ...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM