如何取得局域网用户的登陆名?

aomeng 2001-07-11 09:06:35
在一个NT局域网中,当一个用户从一个工作站上访问另一个工作站是,如何取得这个用户的登陆帐号名。

谢谢!
...全文
138 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
hssfox 2001-11-20
  • 打赏
  • 举报
回复
关注
Rain_Z001 2001-08-14
  • 打赏
  • 举报
回复
Windows 2000 and later: Use the GetUserNameEx function to retrieve the user name in a specified format. Additional information is provided by the interface.

BOOL GetUserName(
LPTSTR lpBuffer, // name buffer
LPDWORD nSize // size of name buffer
);
Parameters
lpBuffer
[out] Pointer to the buffer to receive the null-terminated string containing the user's logon name. If this buffer is not large enough to contain the entire user name, the function fails. A buffer size of (UNLEN + 1) characters will hold the maximum length user name including the terminating null character. UNLEN is defined in Lmcons.h.
nSize
[in/out] On input, specifies the maximum size, in TCHARs, of the buffer specified by the lpBuffer parameter. On output, receives the number of characters copied to the buffer.
If the buffer is not large enough, the function fails and nSize receives the required buffer size, in TCHARs, including the terminating null character.

Return Values
If the function succeeds, the return value is a nonzero value, and the variable pointed to by nSize contains the number of TCHARs copied to the buffer specified by lpBuffer, including the terminating null character.

If the function fails, the return value is zero. To get extended error information, call .
MSDN上的!你可以写个com试试
aomeng 2001-08-14
  • 打赏
  • 举报
回复
echo gethostbyaddr(getenv('REMOTE_ADDR')
//getenv("REMOTE_ADDR") 得到浏览者的IP地址, gethostbyaddr($ip) 根据IP得到主机名字。
这是我变通的解决方法。
aomeng 2001-07-13
  • 打赏
  • 举报
回复
win2k professional!
是不是只有管理员的权限才可以.
kahntang 2001-07-12
  • 打赏
  • 举报
回复
你用的是什么系统啊!
gop 2001-07-12
  • 打赏
  • 举报
回复
D:>nbtstat -a IPAddr
查看一下那个用户所在的机器的当前用户名
aomeng 2001-07-12
  • 打赏
  • 举报
回复
给点提示好不好?

21,893

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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