For desktop app, how do you get IP address
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
For desktop app, how do you get IP address
I'm been trying to find this in the dictionary or a sample, but not having much luck.
I see hostAddressToName in the dictionary. Perhaps someone can point me somewhere. Thanks.
I see hostAddressToName in the dictionary. Perhaps someone can point me somewhere. Thanks.
Last edited by shawnblc on Fri Feb 28, 2014 11:51 pm, edited 1 time in total.
Re: For desktop add, how to get IP address
yeah, this question comes up every now and then, and the answer depends a lot on what you're trying to do. Are you behind a router in a subnet? Do you want the local ip address or a public ip address?
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: For desktop add, how to get IP address
mwieder wrote:yeah, this question comes up every now and then, and the answer depends a lot on what you're trying to do. Are you behind a router in a subnet? Do you want the local ip address or a public ip address?
For my desktop app I want to log the ip address of the user using it. There will eventually be a windows version and a osx version.
For example I'd like this information logged:
$_SERVER['HTTP_X_FORWARDED_FOR']
$_SERVER['REMOTE_ADDR']
Re: For desktop add, how to get IP address
So... forgive me for being a bit confused here...
1 You've got a server app running and you'd like to log the remote user's ip address?
or
2. You're running a desktop app and for some reason want to log the user's ip address locally?
1 You've got a server app running and you'd like to log the remote user's ip address?
or
2. You're running a desktop app and for some reason want to log the user's ip address locally?
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: For desktop add, how to get IP address
It's a local desktop app, but I'd like to be able to log the users IP address. So when they first start the app up it'll log it to a database.mwieder wrote:So... forgive me for being a bit confused here...
1 You've got a server app running and you'd like to log the remote user's ip address?
or
2. You're running a desktop app and for some reason want to log the user's ip address locally?
This can be done with php, but since I'm using lc I'd rather do it all within lc.
Re: For desktop app, how do you get IP address
OK. So do you want the user's public-facing ip address or their local address (assuming a router is in place)? Or do you care which?
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: For desktop app, how do you get IP address
The public.mwieder wrote:OK. So do you want the user's public-facing ip address or their local address (assuming a router is in place)? Or do you care which?
Re: For desktop app, how do you get IP address
In that case, let me point you to http://forums.runrev.com/viewtopic.php? ... ame#p75403 which should give you what you need.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: For desktop app, how do you get IP address
mwieder wrote:In that case, let me point you to http://forums.runrev.com/viewtopic.php? ... ame#p75403 which should give you what you need.
Between that and a little php coding I'll get exactly what I need. Thank you sir.
Code: Select all
on mouseUp
answer the hostNameToAddress of the hostName
end mouseUp
Re: For desktop app, how do you get IP address
That will give you the local ip address, not the public one.answer the hostNameToAddress of the hostName
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: For desktop app, how do you get IP address
Just attached it to a button and I see that. I see they were also querying a url for the public ip in that thread. Thanks. You helped me though.mwieder wrote:That will give you the local ip address, not the public one.answer the hostNameToAddress of the hostName
Re: For desktop app, how do you get IP address
Yeah, the external url is a good way to get the public ip address.
Glad it helped.
Glad it helped.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev