Hi;
Develop in C # a windows service which looks for open remote ports: "netstat -ano" then log this information in a file or a windows log.
as keywords to search: netstat, windows service with c #.
c# How to get actual user id & IP when user Connect to other PC via remote desktop
T.Zacks
3,991
Reputation points
I have a one server and a c# based console application is running there. Now there are 5 users who login to server via remote desktop using same admin login.
i want when any user close my console application running on server then i want to log the user id and ip in a text file. so how to get user id & IP of user pc from console application running on server who login there via remote desktop?
please guide me.
Thanks
2 answers
Sort by: Most helpful
-
Arharbi, Adnane 136 Reputation points
2021-07-24T01:55:17.157+00:00 -
Castorix31 85,126 Reputation points
2021-07-24T07:39:58.91+00:00 I cannot test for your particular case, but it should work with WTS Apis (P/Invoke), mainly
WTSEnumerateSessions
WTSQuerySessionInformation