Indigo Rose Software

Professional Software Development Tools

 
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Nov 2004
    Posts
    26

    Peekaboo! How to setup a click event to pull current local IP and external IP

    Sorry this might not be possible but is there a way to click on an icon to dispaly the current IP address. IF so good..


    second if that is possible is there a way the pull an external IP though that command as well.

  2. #2
    Join Date
    Aug 2003
    Posts
    2,427
    Check out the System.GetLANInfo action which returns a table one of the items of which is the IP address.

    You need the Pro version of AMS5

  3. #3
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Quote Originally Posted by slafta
    second if that is possible is there a way the pull an external IP though that command as well.
    when you ay external IP address, is it another NIC in your PC or are you referring to a firewall/router box that is providing NAT? If so, I am not aware of a way to pull that information. If AMS could communicate via SNMP and your router had SNMP you could potentially use that.

    Another route is to use the AMS HTTP actions to try and login securly to the router and obtain the IP address that way. But I don't know if it will be easy or possible.

    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  4. #4
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    You could use a web object and go to a site like:

    http://www.findmyip.com

    then parse the source for your extrernal IP.

  5. #5
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    In looking at the source to see how it is formatted, I found this

    Code:
    <!-- Please do not "script" this site without permission -->
    <!-- Your IP address is:<br>127.0.0.1</FONT> -->
    <!-- Please do not "script" this site without permission -->
    So I guess if you go that route, Please do not "script" this site without their permission.

    Looks like you would have to do a lot of scripting since they display your IP address with gif files. But the nice thing is that the name of the gifs are "1default.gif", "2default.gif", "3default.gif" etc or ".default.gif"

    Tigg
    Last edited by TJ_Tigger; 02-09-2005 at 08:49 AM.
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  6. #6
    Join Date
    Aug 2003
    Posts
    2,427
    It would be helpful to know what the scenario behind this is. A DNS lookup would be more helpful would be my guess unless were talking about a machine IP and a network gateway 'outward facing' IP perhaps.
    Last edited by longedge; 02-09-2005 at 01:31 PM.

  7. #7
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    This site returns information in the title bar of the window.

    http://www.whatismyip.com/

    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  8. #8
    Join Date
    Dec 2003
    Location
    The Netherlands
    Posts
    475
    Here you have a application i did which will find your wan ip and host.

  9. #9
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Quote Originally Posted by sside
    Here you have a application i did which will find your wan ip and host.
    Can you share your project or how you accomplished the task?

    Thx
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  10. #10
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Hey! What's my blood type doing in that list! (just'a kiddin')

    That works like a champ. Thanks for sharing sside!

    Intrigued

  11. #11
    Join Date
    Dec 2003
    Location
    The Netherlands
    Posts
    475
    Button On Click
    Code:
    url = Web.GetURL("Web1");
    if (url ~= "") then
    if (url ~= "http://www.yoursite.com/script.php") then
    strurl = String.Replace(url, "http://www.yoursite.com/script.php?ip=", "", false);
    
    strwanip = String.Find(strurl, "?", 1, false);
    strhost = String.Find(strurl, "=", 1, false);
    
    wanip = String.Left(strurl, strwanip-1);
    host = String.Mid(strurl, strhost+1, -1);
    
    Input.SetText("InputLANIP", System.GetLANInfo().IP);
    Input.SetText("InputWANIP", wanip);
    Input.SetText("InputHOST", host);
    end
    end
    PHP Script

    PHP Code:
    <?php
    if (!$ip)
    {
    $ip $_SERVER['REMOTE_ADDR'];
    $host gethostbyaddr($_SERVER['REMOTE_ADDR']);
    echo 
    '<meta **********="refresh" content="0;URL=http://www.yoursite.com/script.php?ip='.$ip.'?host='.$host.'">';
    }
    ?>

  12. #12
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Thanks sside, I figured it had to be a script on a remote server. Very nice. Gives me some good ideas for things I have wanted to do.

    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  13. #13
    Join Date
    May 2001
    Location
    51.531249 | -0.610962
    Posts
    1,244
    I looked at doing something that required LAN/WAN IP addresses recently. Now I know where to go on that one, thanks

    [just need to get a script server set up! ]
    -
    = Derek
    ["All glory comes from daring to begin" - fortune cookie]

  14. #14
    Join Date
    Dec 2003
    Location
    The Netherlands
    Posts
    475
    Intrigued, Tigg, Derek, you're welcome. I hope you find this useful.

  15. #15
    Join Date
    Nov 2004
    Posts
    26

    re:

    code the php site be executed locally, here is the scenario, i want to on click pull the values, and write to text files,

    thanks

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts