Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,
I need help locking my application to one IP address, so I would write the IP address inside the program. Any ideas how i would get the clients IP to compare to the one hard coded inside the application. Sorry for my bad english! :)
Posted
Comments
Jochen Arndt 22-Jan-16 3:04am    
Which operating system?

You may also ask your preferred search machine using "c++ [your OS] detect client IP" to get lot of examples which should be basically all the same for a specific OS.
Richard MacCutchan 22-Jan-16 5:15am    
What is the purpose of the IP address in your program?

Considering IP addresses for clients usually change over time this is a really bad idea and limits the usefulness and supportability of the application.
 
Share this answer
 
It is not an good idea. For secure access you should use encryption like https or some vpn.

If you really want to hard code your IP you should to some math to calculate it from some constants.

To get your local ip address look at this example code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900