Search the web
Sign In
New User? Sign Up
magicu-l · uniPaaS (Magic) Software Users Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Get IP Address of Workstation in UniPaaS 1.8   Message List  
Reply | Forward Message #144252 of 148725 |
RE: [magicu-l] Get IP Address of Workstation in UniPaaS 1.8

Jim,



Whatever method you use, make sure you wrap it inside of a small Magic batch
program or a function. That way if the method you use to obtain an IP
address changes, the rest of your application will not know the difference.



Keith



From: magicu-l@yahoogroups.com [mailto:magicu-l@yahoogroups.com] On Behalf
Of Erik Hagendijk
Sent: Friday, July 03, 2009 3:50 PM
To: magicu-l@yahoogroups.com
Subject: Re: [magicu-l] Get IP Address of Workstation in UniPaaS 1.8








Hi Jim,

With the ipconfig approach you need to parse the output if you want
just the IP address. The challenge is that the ipconfig output format
depends on IP configuration and Windows version.

As an alternative you can simply initialize or update a Magic variable
with the result of a Java method. The Java method you are looking for
(including the Java source and a one line Magic program calling this
method) can be downloaded from our website.

Just download the file callJava.zip from
http://www.magic2java.com/Calling_Java_Methods.html
. The included .exp files are V9 export programs that show you how to
call the Java methods. Extract the M2J.jar from the zip and include it
in the CLASSPATH (which can be done in your Magic.ini).

Erik

PS Another side benefit of the Java alternative over ipconfig is that
it keeps your Magic application logic portable to non Windows
platforms. Magic application logic that relies on net.get_ip is
portable to non Windows platforms (the M2J converter automatically
replaces your Magic application logic, including calls to net.get_ip
and the net.get_ip functionality with calls to appropriate Java code).

Erik Hagendijk
M2J Software LLC, USA
p +1 (714) 389 2652
f +1 (714) 389 2653
erik@... <mailto:erik%40magic2java.com>
www.magic2java.com

On Jul 3, 2009, at 8:09 AM, Keith Canniff wrote:

>
>
> Jim,
>
> Simple old fashioned way:
>
> Invoke OS (shell to OS), ipconfig >ip.txt
>
> The read the contents of the text file.
>
> Keith
>
> From: magicu-l@yahoogroups.com <mailto:magicu-l%40yahoogroups.com>
[mailto:magicu-l@yahoogroups.com <mailto:magicu-l%40yahoogroups.com> ] On
> Behalf
> Of Jim Stephenson
> Sent: Friday, July 03, 2009 11:06 AM
> To: Magic Mailing List
> Subject: [magicu-l] Get IP Address of Workstation in UniPaaS 1.8
>
> How can I get the IP address of the workstation a UniPaaS 1.8
> application is
> running on?
>
> In previous versions I used net.get_ip. But I can't run get for this
> application (political reasons).
>
> A similar need will also be to get the IP address of a workstation
> that is
> running a UniPaaS application through terminal services. The address
> I will
> want is not the Terminal server, but the remote workstation's.
>
> Jim
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
>
>

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]




Fri Jul 3, 2009 8:23 pm

kbcanniff
Offline Offline
Send Email Send Email

Forward
Message #144252 of 148725 |
Expand Messages Author Sort by Date

How can I get the IP address of the workstation a UniPaaS 1.8 application is running on? In previous versions I used net.get_ip. But I can't run get for this ...
Jim Stephenson
jimhstephenson
Offline Send Email
Jul 3, 2009
3:06 pm

Jim, Simple old fashioned way: Invoke OS (shell to OS), ipconfig >ip.txt The read the contents of the text file. Keith From: magicu-l@yahoogroups.com...
Keith Canniff
kbcanniff
Offline Send Email
Jul 3, 2009
3:10 pm

Hi Jim, With the ipconfig approach you need to parse the output if you want just the IP address. The challenge is that the ipconfig output format depends on IP...
Erik Hagendijk
ehagendijk
Offline Send Email
Jul 3, 2009
7:50 pm

Jim, Whatever method you use, make sure you wrap it inside of a small Magic batch program or a function. That way if the method you use to obtain an IP address...
Keith Canniff
kbcanniff
Offline Send Email
Jul 3, 2009
8:24 pm

Thanks Eric and Keith, I have the ipconfig version working (using a batch program), but I think I will try the Java method too, just to see what it does...
Jim Stephenson
jimhstephenson
Offline Send Email
Jul 5, 2009
4:14 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help