也就是能否获得登录windows的用户名
------解决方案--------------------------------------------------------
当然可以
------解决方案--------------------------------------------------------
用API GetUserName
声明:
Function ulong GetUserName(ref string lpBuffer,ref ulong nSize) LIBRARY "advapi32.dll " ALIAS FOR "GetUserNameA "
写代码:
string ls_name
ulong ul_size
ulong ul_ret
ul_size = 256
ls_name = space(256)
ul_ret = GetUserName(ls_name,ul_size)
if ul_ret =0 then
messagebox( "提示 ", "获取用户名失败 ")
else
messagebox( "提示 ",ls_name)
end if