Hi Loyd,
Viewing this in the "I have never done this before but I think it should
work" category ...
If the PC's are in the same small network as the webserver then you might
be able to extract the MAC address for the remote client. I believe it
should remain constant even if the IP address changes.
I found this that you might be able to adapt :
http://www.kodejava.org/examples/250.html but it requires Java 6 it seems
There is also this :
http://sourcezone.wordpress.com/2008/02/14/java-how-to-get-the-mac-addresses-of-network-cards/
To figure out the remote MAC address from your Windows PC for some
fictional machine at ip address 1.2.3.4 you can do something like this :
c:\>ping 1.2.3.4
Pinging 1.2.3.4 with 32 bytes of data:
Reply from 1.2.3.4: bytes=32 time=2ms TTL=64
Reply from 1.2.3.4: bytes=32 time=1ms TTL=64
Reply from 1.2.3.4: bytes=32 time=1ms TTL=64
Reply from 1.2.3.4: bytes=32 time=1ms TTL=64
Ping statistics for 1.2.3.4:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 2ms, Average = 1ms
c:\>
c:\>arp -a 1.2.3.4
Interface: localmachine --- 0x2
Internet Address Physical Address Type
1.2.3.4 00-50-70-d6-47-94 dynamic
c:\>
So even if the first Java 6 solution does not work you could use some
system calls or cgi or whatever to figure it out I think.
Mike
Mike Hockings, P.Eng.
IBM Rational Developer for System z Support
IBM Canada Ltd. Laboratory
hockings@xxxxxxxxxx
voice 1-905-413-3199 T/L 313-3199 ITN 23133199
http://www.ibm.com/software/rational/cafe/community/hats
From:
Loyd Goodbar <loyd@xxxxxxxxxxxxxx>
To:
web400@xxxxxxxxxxxx
Date:
03/02/2010 04:41 PM
Subject:
[WEB400] Determining client PC to print on different i5OS printers
Sent by:
web400-bounces@xxxxxxxxxxxx
Keeping as much programming the same as possible, what are some ways to
denote a location between two PCs running the same web page? What I need
is
to know which PC is accessing the web pages so I print labels to the
appropriate printer.
We have a visitor sign in/out lobby kiosk running from a dedicated PC and
an
i5/OS-connected label printer (Intermec). The PC connected to our iSeries
via web pages made with RPG and CGIDEV2. During the sign in process, guest
names are written to a file, which is directed to TL Ashford to print the
labels.
We need to implement a second kiosk in our shipping department at the
opposite end of the building. We need to print to a different label
printer.
TL Ashford allows us to set the output queue when printing. We will have a
separate PC and label printer in the new area.
Using my PC, I checked the i5 HTTP server variables for clues. (A sample
program is at
http://www.easy400.net/cgidev2p/dspsrc.pgm?cgiinp01=cgidev2&cgiinp02=qrpglesrc&cgiinp03=envvar
.) While
REMOTE_ADDR is populated (IP address), REMOTE_HOST is not. I do not want
to
go by IP address since it's dynamically assigned, and not sure how much
effort it would be to get our admins to make it static. I could make
separate start pages such as startlobby.pgm and startship.pgm, set cookies
and read them on subsequent pages.
Any suggestions welcome!
Thanks,
Loyd
As an Amazon Associate we earn from qualifying purchases.