|
-
Jan 26th, 2010, 03:17 AM
#1
Create a free service
Hi,
See this site: http://www.findmyipaddress.info/Show...ess_image.aspx
How can I create some free service like that...???? Is it possible in ASP...???
What are the necessary things needed to keep in mind...??? How is the IP passed to my server...???
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jan 26th, 2010, 08:36 AM
#2
Re: Create a free service
This prints out the IP address of the visitor.
Code:
<%=Request.ServerVariables("REMOTE_ADDR")%>
For more server variables visit this link.
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Jan 26th, 2010, 08:40 AM
#3
Re: Create a free service
If you want an ASP .NET based solution you may use the following code.
PHP Code:
string ip; ip=Request.ServerVariables("HTTP_X_FORWARDED_FOR"); if(ip==string.Empty) { ip=Request.ServerVariables("REMOTE_ADDR"); }
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Jan 26th, 2010, 11:34 AM
#4
Re: Create a free service
If your real need is the ability to "discover" the public IP address of a NAT router from inside your programs there are alternatives. One is to ask the router itself.
[VB6] PortMapper - UPnP NAT Traversal Class can do this if you make a few assumptions: the router must be somewhat recent and support UPnP, the router must have UPnP enabled, the OS must be WinXP or later, the OS must have Network Discovery installed and enabled (typically it is), and the Windows firewall (or other software firewall) must allow UPnP traffic through it.
That may sound like a lot of "ifs" but it really isn't too bad. And once you have that your program can automatically map ports through to your server program as well.
Use the latest version there. The only part I hadn't added was the ability to set the Windows Firewall to allow TCP or UDP ports "through" but this can also be automated with a little more work and a DLL from the DirectX SDK (or a little more work using standard API calls).
-
Jan 27th, 2010, 12:35 PM
#5
Re: Create a free service
Thanks for the reply... 
Actually, I want the country name of the user.... And display some message like, "you are from India". I think, IP address can be used to track this down....
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jan 27th, 2010, 01:53 PM
#6
Re: Create a free service
 Originally Posted by akhileshbc
Thanks for the reply...
Actually, I want the country name of the user.... And display some message like, "you are from India". I think, IP address can be used to track this down....
You might want to read this article.
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Jan 27th, 2010, 09:08 PM
#7
Re: Create a free service
Thanks abhi.... 
Ok... Now I know to track the the Country from IP Address...
What should I have to do, if I want this feature to be publically available...??? I mean, users can use this service in their website or in forums, by copying and pasting a code from my website...
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jan 28th, 2010, 12:42 PM
#8
Re: Create a free service
Yes. You'll need to create a web service.
Are you working with ASP or ASP .NET?
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Jan 28th, 2010, 12:49 PM
#9
Re: Create a free service
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jan 29th, 2010, 10:42 PM
#10
Re: Create a free service
You're going to have to write out graphic objects yourself. This sucks in Classic ASP.
Also, this isn't a web service; this is simply letting browsers download an image from your server; you're just dynamically generating the image.
In ASP.Net you'd create a generic handler for this but a content page would also work (just has extra overhead). In Classic ASP you'd just create a new page.
Make sure to return the appropriate headers for the image format you're writing out and you'll need to write this data to the response buffer so that it's sent to the user as a file.
Captchas work this way as well so if you search for a tutorial you could look for those as well.
-
Jan 29th, 2010, 10:50 PM
#11
Re: Create a free service
Thanks Kasracer 
Is it possible to track the ip address of the user using this method....???? (I will be displaying the Country Name in a picture(like you said) on the webpage.... People can copy - paste the link from my site, so that this image or service can be used in their forum signature or websites, etc...)
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jan 29th, 2010, 11:07 PM
#12
Re: Create a free service
Yes. Every request made to a web server includes the client's IP address. Naturally, this can be spoofed, but you should be able to grab this information out of the HTTP headers as shown above. You'll just need to figure out how to map an IP address to a country.
-
Jan 29th, 2010, 11:28 PM
#13
Re: Create a free service
You'll just need to figure out how to map an IP address to a country.
Yeah... I had gone through some Googling and find some codes...
Database found here
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
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
|