Results 1 to 13 of 13

Thread: Create a free service

  1. #1

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    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,...

  2. #2
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Re: Create a free service

    This prints out the IP address of the visitor.

    Code:
    <&#37;=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

  3. #3
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    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

  4. #4
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    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).

  5. #5

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    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,...

  6. #6
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Re: Create a free service

    Quote Originally Posted by akhileshbc View Post
    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

  7. #7

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    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,...

  8. #8
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    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

  9. #9

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Create a free service

    Classic ASP

    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,...

  10. #10
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    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.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  11. #11

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    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,...

  12. #12
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    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.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  13. #13

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    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
  •  



Click Here to Expand Forum to Full Width