?? getusername.htm
字號:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<style><!--
body,table {font-family:"宋體"; font-size: 9pt; line-height:11pt;}
a {text-decoration:none} a:hover {color:red;text-decoration:underline}
--></style>
<title>GetUserName</title>
</head>
<body link="#FF0000" vlink="#FF0000" alink="#FF0000" bgcolor=#E2DEE9>
<div align="center"><center>
<table border="0" width="100%" height="22" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="16">GetUserName</td>
</tr>
</table>
</center></div><div align="center"><center>
<table border="1" width="100%" bordercolorlight="#808080" cellspacing="0"
bordercolordark="#FFFFFF">
<tr>
<td width="102%" colspan="2">VB聲明</td>
</tr>
<tr>
<td width="102%" colspan="2">Declare Function GetUserName Lib "advapi32.dll"
Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long</td>
</tr>
<tr>
<td width="102%" colspan="2">說明</td>
</tr>
<tr>
<td width="102%" colspan="2">取得當(dāng)前用戶的名字</td>
</tr>
<tr>
<td width="102%" colspan="2">返回值</td>
</tr>
<tr>
<td width="102%" colspan="2">Long,TRUE(非零)表示成功,否則返回零。會設(shè)置<a
href="GetLastError.htm" tppabs="http://www.gxbcts.com/airfly/api/papi/GetLastError.htm">GetLastError</a></td>
</tr>
<tr>
<td width="102%" colspan="2">參數(shù)表</td>
</tr>
<tr>
<td width="25%">參數(shù)</td>
<td width="77%">類型及說明</td>
</tr>
<tr>
<td width="25%">lpBuffer</td>
<td width="77%">String,一個字串緩沖區(qū),預(yù)先初始化成由nSize指定的長度。它將用于容納用戶名</td>
</tr>
<tr>
<td width="25%">nSize</td>
<td width="77%">Long,初始化成lpBuffer的長度。返回以后,它會包含載入lpBuffer的字符數(shù)量</td>
</tr>
<tr>
<td width="102%" colspan="2">示例</td>
</tr>
<tr>
<td width="102%" colspan="2"><p align="left">Dim s$, cnt&, dl&<br>
cnt& = 199<br>
s$ = String$(200,0)<br>
dl& = GetUserName(s$, cnt)<br>
Debug.Print Left$(s$, cnt); cnt</td>
</tr>
</table>
</center></div><div align="center"><center>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><p align="right">Top</td>
</tr>
</table>
</center></div>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -