|
-
Oct 5th, 2008, 09:59 PM
#1
Thread Starter
Addicted Member
[RESOLVED] [2008] Log Remote IP Address Of User
Anyone help me with code to log user ip and sent it to remote server. I am going to have a script created that is going to allow me to send remote messages via php script back to users who install my software.
What I am wondering is adding code into the application to post user ip and computer name back to a database or file so I can have records of it and if someone is using my software illegally ( not pay for it ) then I can record their information and send them a message about the illegal use.
I also wondered about being able to remotely disable the software if a cracker cracks it? Anyone have exp. with that?
I found code to get local but not remote address.
Chris
Last edited by cmmorris1; Oct 5th, 2008 at 11:30 PM.
-
Oct 6th, 2008, 08:07 AM
#2
Re: [2008] Log Remote IP Address Of User
If the client computer connects to the Internet directly (no router), you should be able to get the public IP no problem by using System.Net.NetworkInformation. However, if the computer is behind a router, that only gives you the private IP that the router assigned to the computer. You'll need to read the public IP of the router instead. In this case, you'll need to create a website and have your application request a page from your own website. The website then read the ip address of the requesting host and send it back to your application (or just logs it at the web server, since this is what you want after all).
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Oct 6th, 2008, 11:59 AM
#3
Thread Starter
Addicted Member
Re: [2008] Log Remote IP Address Of User
Thanks stanav. yeah...that's exactly what I was looking for. I need to have the application request a page from my server and then grab the ip and put that into the db.
What code could I use to do that silently? I do not want the user to know of the callback to the server.
Chris
-
Oct 6th, 2008, 12:54 PM
#4
Re: [2008] Log Remote IP Address Of User
Have a look at System.Net.HttpWebRequest class. You should be able to find plenty of examples on this forum or the Internet.
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Oct 6th, 2008, 11:56 PM
#5
Thread Starter
Addicted Member
Re: [2008] Log Remote IP Address Of User
Perfect...got it to work finally!
Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|