gpt4 book ai didi

delphi - 在 Delphi 中获取本地计算机名称的最佳方法是什么

转载 作者:行者123 更新时间:2023-12-03 15:02:45 32 4
gpt4 key购买 nike

代码需要兼容D2007和D2009。

<小时/>

我的回答:感谢所有回答的人,我同意:

function ComputerName : String;
var
buffer: array[0..255] of char;
size: dword;
begin
size := 256;
if GetComputerName(buffer, size) then
Result := buffer
else
Result := ''
end;

最佳答案

Windows API GetComputerName应该管用。它在 windows.pas 中定义。

关于delphi - 在 Delphi 中获取本地计算机名称的最佳方法是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1156544/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com