|
|
|
| Добрый день
Мне нужна функция, которая показало бы имя компьютера, с которого произведено действие.
Заранее спасибо за помощь | |
|
| |
|
|
|
| нашёл...
Option Explicit
Private Declare Function GetComputerName _
Lib "kernel32" Alias "GetComputerNameA" ( _
ByVal lpBuffer As String, nSize As Long) As Long
Private Const MAX_COMPUTERNAME_LENGTH As Long = 15&
Public Function CurrentMachineName() As String
Dim lSize As Long
Dim sBuffer As String
sBuffer = Space$(MAX_COMPUTERNAME_LENGTH + 1)
lSize = Len(sBuffer)
If GetComputerName(sBuffer, lSize) Then
CurrentMachineName = Left$(sBuffer, lSize)
End If
End Function | |
|
| |
|
|
|
|
Sub testEnviron()
Dim i As Long
For i = 1 To 41
Debug.Print Environ$(i)
Next i
End Sub
|
Твоё - Debug.Print Environ("COMPUTERNAME") | |
|
| |