Pas de dépendances
#include <windows.h> #include <tchar.h> #include <lmcons.h> int main() { int taillecomptername; int tailleusername; TCHAR computername[UNLEN+1]; TCHAR username[UNLEN+1]; taillecomptername = UNLEN+1; tailleusername = UNLEN+1; GetComputerName(computername,&taillecomptername); GetUserName (username,&tailleusername); _tprintf(_T("nom ordi : %s ; taille = %d\n"),computername,taillecomptername); _tprintf(_T("nom utilisateur : %s ; taille = %d\n"),username,tailleusername); return 0; }
No explanations yet.