GetComputerName-GlobalFunction
The GetComputerName function retrieves the NetBIOS name of the local computer.
BOOL GetComputerName( LPSTR lpBuffer, DWORD * lpnSize )
If the function succeeds, the return value is a nonzero value.
If the function fails, the return value is zero.
EX1
int GetComputerName_ex1() { char szComputerName[MAX_PATH]; DWORD dwSize = MAX_PATH; if( GetComputerName(szComputerName, &dwSize) ) printf("Computer Name is %s\n", szComputerName); else printf("Error calling GetComputerName\n"); return 1; }
GetUserName
origin.h