Way to snag IP address in EXE application?

General conversation about our product. Get help with your 'How To' questions.
Post Reply
indyrhett
Posts: 43
Joined: Wed Aug 02, 2017 10:56 pm

Way to snag IP address in EXE application?

Post by indyrhett » Wed Aug 02, 2017 10:57 pm

Is there a way to determine inside your Windows Application the IP Address of the user logging in with the HTML 5 Client? Like maybe some Windows ENV variable?

Thanks,

Rhett Price
IndySoft

juwagn
Site Admin
Posts: 239
Joined: Wed Oct 15, 2014 8:25 pm

Re: Way to snag IP address in EXE application?

Post by juwagn » Thu Aug 03, 2017 7:47 am

Hello,

theoretically I could implement it but practically that would only work if your server is NOT behind router, also visible directly to internet so that the network card gets internet IP else by intranet IPs it makes zero sense.
So the question, how does it look by you, do you fulfill requirements for this feature?
TSplus HTML5 and Java web engineer

indyrhett
Posts: 43
Joined: Wed Aug 02, 2017 10:56 pm

Re: Way to snag IP address in EXE application?

Post by indyrhett » Thu Aug 03, 2017 3:12 pm

Hi, yes that makes sense. I understand it wouldn't be perfect however mainly what I'm trying to determine is some Uniqueness for our application licensing. We currently allow the same user to login multiple times on the same computer while only consuming 1 license. So, we currently store: User Name + IP Address when logging in. This clues us in they are on the same computer. Logging in with the same user name and 2 different IP addresses wouldn't be allowed. I do see how you could run into a problem though where users behind a router would possibly all returning the same IP...?

With this being said, do you know of a good way for us to detect when a TSPlus session is on the same computer vs another?

Thanks,

Rhett Price
IndySoft

juwagn
Site Admin
Posts: 239
Joined: Wed Oct 15, 2014 8:25 pm

Re: Way to snag IP address in EXE application?

Post by juwagn » Sat Aug 05, 2017 5:46 am

Hello,
detect when a TSPlus session is on the same computer vs another
For html5 client only you can determine it with clientname environmental variable.
cmd.exe > echo %clientname%
by beginning with point . (and exact 15 chars long inclusive point, since point is unallowed char in computer name and so would never be reported by native client) you can distinguish if it is html5 session and the rest is unique id generated by browser and stored in cookies, new session would reuse it, so you can distinguish if same user logged in with html5 client.
But unique id will be regenerated (randomly) if deleted from cookies forcibly, so there is no 100% way to differentiate unique user but at lest with "clientname" you are on good way there.
TSplus HTML5 and Java web engineer

indyrhett
Posts: 43
Joined: Wed Aug 02, 2017 10:56 pm

Re: Way to snag IP address in EXE application?

Post by indyrhett » Sat Aug 05, 2017 8:11 pm

Fantastic! This seems exactly what we need. Testing to confirm but this looks like it will do the trick.

Thanks!

User avatar
Ryan Taylor
Posts: 1
Joined: Mon Sep 25, 2017 9:14 am

Re: Way to snag IP address in EXE application?

Post by Ryan Taylor » Mon Sep 25, 2017 9:15 am

Works for me!
Wanna know what's the most important thing to me right now?. That's right. Right now I want to learn the facts here now about those slots. No wonder this place is so popular.

Post Reply