最简单的方法,用Winsock控件!
解决方案 »
- 请大家推荐关于在vb中开发ocx或dll之后在web中调用的有关书籍或文章
- 怎么用这个Armadillo对文件进行加密啊
- 把添加到DataGrid控件中的数据刷新到数据库里的代码?在线等,谢谢!
- 判断数据库中是否存在同名表?
- vb的一个除法问题,大家帮忙了。
- VB +ACCESS2000的问题
- 好急!好急!请问哪位大侠有把ACCESS的表转换为EXCEL的原代码?????
- 求日文Win2000下五笔输入法!!
- 旋转VB PICTUREBOX控件
- 请帮忙作一个小项目!请详细写出代码
- 有人说我的名字[Microshaoft(大舌头)]起得很好玩!? 你们说呢???
- 为什么我在picturebox用API函数drawedge没反映
'
' This will obtain the users logged on name once from the system. The
' second time it is called it returns the static 'sName' variable
'
Static sName As String
Dim lBuffLen As Long
Dim sBuffer As String
Dim lRet As Long
If Len(sName) > 0 Then
GetUserLogonName = sName
Exit Function
Else
lBuffLen = 128
sBuffer = String$(lBuffLen, vbNullChar)
lRet = GetUserName(sBuffer, lBuffLen)
If lRet < 0 Then
'
' Handle error from API here
'
Exit Function
End If
sName = Left$(sBuffer, lBuffLen - 1)
GetUserLogonName = sName
End IfEnd Function
'用API函?吧.保?成功.
Public Declare Function GetComputerName Lib "Kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Public Function GetComName() As String
Dim strBuffer As String
Dim Com As String
Dim ingLen As Long
strBuffer = Space(30)
ingLen = Len(strBuffer)
Call GetComputerName(strBuffer, ingLen)
Com = Left$(strBuffer, ingLen)
GetComName = Com
End Function