/ Published in: Visual Basic
Expand |
Embed | Plain Text
Public Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long 'コンピュータ名の取得 ' Private Function gfGetComputerName() As String Dim lngRetValue As Long Dim CompName As String * 128 Dim CompNameSize As Long CompNameSize = Len(CompName) lngRetValue = GetComputerName(CompName, CompNameSize) If lngRetValue <> 0 Then gfGetComputerName = Left$(CompName, InStr(CompName, vbNullChar) - 1) End If gfGetComputerName = LeftQ(gfGetComputerName, 15) End Function
You need to login to post a comment.
