Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gettting network identification

Status
Not open for further replies.

elidag

Programmer
Joined
May 28, 2002
Messages
8
Location
NL
Hello all,
I am working on a small program where I need to know the network identity of the computer the app is running on. This will be used on a win2000 server operating system. I have tried various method but not luck yet. Any ideas welcome.
thanks
Dave
 
hi,
what do you mean with "network identity"
computer name, username, ip-address of one of the nic(s) ???

The program stays on a 2K server( the file stays on a share,but it is launched from a client)
or run on a 2k Server ?

bye
 
Hi,
thanks for the prompt reply

I mean the computer name and the app will run on the server

Davw
 
Check this function

NetWkstaGetInfo()

/JOlesen
 
Hi,
I don't know which tools you are using to write window program, but I used Visual Studio 6

char buf[128];
DWORD len=sizeof(buf)-1;
if( !GetUserName( buf, &len ) )// address of name buffer
sprintf( buf, "%d", GetLastError() ) ;
AfxMessageBox(buf);

use

BOOL GetComputerName(
LPTSTR lpBuffer,
LPDWORD lpnSize
);

with the same mechanism

and have a look at


and functions near it

bye
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top