本文整理自网络,侵删。
function GetComputerName: string;var buffer: array [0 .. MAX_COMPUTERNAME_LENGTH + 1] of Char; Size: Cardinal;begin Result := 'N/A'; Size := MAX_COMPUTERNAME_LENGTH + 1; Winapi.Windows.GetComputerName(@buffer, Size); Result := StrPas(buffer);end;
procedure TForm1.FormCreate(Sender: TObject);beginform1.Caption:=GetComputerName;end;
相关阅读 >>
Delphi 关于选择文件路径 selectdirectory 弹出窗口居中的问题
更多相关阅读请进入《Delphi》频道 >>