Ask the Expert

Capturing a unique TCP/IP address/name of client machine/workstation ID in VB

We are using AS/400 s20 in client server environment--our application is VB 5.0. We would like to know whether we can capture a unique TCP/IP address/name of client machine/workstation ID in VB, so we can store it in a database as a part of a audit trail in the transaction? A detailed reply to tackle this problem would be highly appreciated.

I assume from your scenario that your VB application is running on a Windows client: Windows98, Windows2000 or Windows NT workstation.

I'm sorry I don't do VB programming. I do LotusScript (a VB like language) and Java. In both those languages, I have access easily through standard API's to the client URL with its hostname or IP address. LotusScript also has direct access to Windows environment variables such as the local COMPUTERNAME.

IF you don't have an equivalent function (which I have to believe VB would provide such access), you can do one of 2 things:

1. Use OLE automation to access a Windows class that can provide access to the local COMPUTERNAME or IP address.

2. Execute a simple BAT command to run an appropriate function like:

ipconfig > myipaddress.txt, then read & parse the generated file, to get the local IP.

Sorry I didn't have a VB specific example.

This was first published in April 2001

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: