GetComputerName API를 이용해 보세요.
아래 예제는 Button을 누르면 자신의 컴퓨터 이름을 받아내는 예제입니다
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
char chString[255];
DWORD itLength;
GetComputerName(chString, &itLength);
chString[itLength] = 0; // 있어두 되고.. 없어두 됨..
ShowMessage(chString);
}
//---------------------------------------------------------------------------
김태균 님이 쓰신 글 :
:
:
:
:
:
:
: 자기 컴 퓨터 이름을 알아 내는 방법이 있을 까요..
: 아시는 분 답변 부탁드립니다.
:
: 좋은 하루 되셔요..
:
:
:
:
|