摘要: Windows: 1 #include <windows.h> 2 #include <stdio.h> 3 4 void PrintHostName(void) { 5 wchar_t hostname[80]; 6 memset(hostname,0,sizeof(hostname)); 7 DWORD i= 80; 8 GetComputerName(hostname,&i); 9 printf("%s",hostname);10 }Mac /Linux:#include <stdio.h>#include <unis 阅读全文
posted @ 2013-03-22 23:45 PenguinChi 阅读(145) 评论(0) 推荐(0)