请大家给个例子

steel1991 2002-12-03 11:45:47
请大家给个下面API的例子:
BOOL GetComputerName(

LPTSTR lpBuffer, // address of name buffer
LPDWORD nSize // address of size of name buffer
);

struct hostent FAR * gethostbyaddr (

const char FAR * addr,
int len,
int type
);

struct hostent FAR * gethostbyname (

const char FAR * name
);
...全文
48 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
cbdiy 2002-12-03
  • 打赏
  • 举报
回复
var Size:DWord;
pComputerName:Pchar;
begin
GetMem(pComputerName,255);
try
Size:=250;
if GetComputerName(pComputerName,Size)=true then
finally
FreeMem(pComputername);
end;

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧