函数参考


_WinAPI_ParseUserName

Extracts the domain and user account name from a fully qualified user name.

#Include <WinAPIEx.au3>
_WinAPI_ParseUserName ( $sUser )

参数

$sUser The user name to be parsed. The name must be in UPN or down-level format, or a certificate.

返回值

Success The array containing the following information:
[0] The domain name (if present).
[1] The user account name.
失败: 返回 0 并设置 @error 标志为非 0 值, @extended 标志可能包含一个系统错误代码.

注意/说明

None

相关

详情参考

在MSDN中搜索


示例/演示


#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)

Global $Data = _WinAPI_ParseUserName('ALX\Alexander')

ConsoleWrite('Domain: ' & $Data[0] & @CR)
ConsoleWrite('User:   ' & $Data[1] & @CR)