在Delphi中获取本地计算机名称的最佳方法是什么
发布时间:2020-12-15 09:45:02 所属栏目:大数据 来源:网络整理
导读:代码需要与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 := '
代码需要与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中定义.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |