About 1,100,000 results
- Viewed 86k times29edited Jan 6, 2017 at 8:18
Windows
You can try to use GetComputerName and GetUserName, here is a example:
#define INFO_BUFFER_SIZE 32767TCHAR infoBuf[INFO_BUFFER_SIZE];DWORD bufCharCount = INFO_BUFFER_SIZE;// Get and display the name of the computer.if( !GetComputerName( infoBuf, &bufCharCount ) )printError( TEXT("GetComputerName") );_tprintf( TEXT("\nComputer name: %s"), infoBuf );// Get and display the user name.if( !GetUserName( infoBuf, &bufCharCount ) )printError( TEXT("GetUserName") );_tprintf( TEXT("\nUser name: %s"), infoBuf );Content Under CC-BY-SA license GetComputerNameA function (winbase.h) - Win32 apps
Explore further
GetComputerNameA 関数 (winbase.h) - Win32 apps ...
- People also ask
c++ - Get Computer Name and logged user name - Stack ...
コンピュータ名を取得する - わびさびサンプルソース
Win32API コンピュータ名を取得する GetComputerName - s-kita ...
GetComputerNameExA function (sysinfoapi.h) - Win32 apps
Declare Function Api_GetComputerName& Lib "kernel32 ...
Get computername from hostname in C++? - Stack Overflow
_GetComputerName関数 - Win32 apps | Microsoft Learn
自分のコンピューター名を表示する
- Some results have been removed