pb代码中如何取客户机名?

pbzjh 2003-10-08 12:03:02
如何取客户机名
...全文
147 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
shinesky 2003-10-08
  • 打赏
  • 举报
回复
用API
Function ulong GetComputerName(ref string lpBuffer,ref ulong nSize) LIBRARY "kernel32.dll" ALIAS FOR "GetComputerNameA"

string ls_lpBuffer
ulong li_nSize

ls_lpBuffer = space(256)//分配空間
li_nsize=256
re_value=GetComputerName(ls_lpBuffer,li_nSize)
messagebox('computer_name',ls_lpBuffer)
szpqq 2003-10-08
  • 打赏
  • 举报
回复
提供一下思路
一是可以用API函数吧
二是可能从注册表中取,如果你知道在注册表中哪里取的话
string ls_titlefont

RegistryGet("HKEY_LOCAL_MACHINE\Software\MyApp.Settings\Fonts", "Title", RegString!, ls_titlefont)

把HKEY_LOCAL_MACHINE\Software\MyApp.Settings\Fonts改成取客户机的路径
佣工7001 2003-10-08
  • 打赏
  • 举报
回复
用API
gethostname

1,108

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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