|
Адрес компьютера из VBA?
|
|||
---|---|---|---|
#18+
А можно как-то из VBA получить адрес компьютера, на котором выполняется макрос? Имя пользователя нашел как получить: Application.UserName, а вот имя или адрес компьютера... ... |
|||
:
Нравится:
Не нравится:
|
|||
20.12.2004, 19:41 |
|
Адрес компьютера из VBA?
|
|||
---|---|---|---|
#18+
Спасибо! Даже больше, чем нужно:) Всегда хотел узнать - где берут такие куски кода? Не пишут же их сами:) ... |
|||
:
Нравится:
Не нравится:
|
|||
22.12.2004, 20:18 |
|
Адрес компьютера из VBA?
|
|||
---|---|---|---|
#18+
Копирайт - в самодокументированном коде. Строка 18: Код: plaintext
... |
|||
:
Нравится:
Не нравится:
|
|||
23.12.2004, 20:16 |
|
Адрес компьютера из VBA?
|
|||
---|---|---|---|
#18+
А чтобы не извращатся с апи можно попользовать WSH wshom.ocx ... |
|||
:
Нравится:
Не нравится:
|
|||
24.12.2004, 11:56 |
|
Адрес компьютера из VBA?
|
|||
---|---|---|---|
#18+
Пардон за банальность, но почему бы не имп API АППЛЕМАН GetComputerName VB Declaration Declare Function GetComputerName& Lib "kernel32" Alias "GetComputerNameA" _ (ByVal lpBuffer As String, nSize As Long) Description Retrieves the name of this computer. Use with VB No problem. Parameter Type/Description lpBuffer String—String buffer to load with the computer name. nSize Long—The length of the buffer. This variable is loaded with the actual length of the computer name on return. Return Value Long—True (nonzero) on success, zero on error. Sets GetLastError. Platform Windows 95, Windows NT Comments Note that the nSize parameter is not passed by value. See Api32.txt for the value of the MAX_COMPUTER_NAME constant. Example Dim s$ s$ = String$(MAX_COMPUTERNAME_LENGTH+1, Ø) Dim dl& Dim sz& sz& = MAX_COMPUTERNAME_LENGTH+1 dl& = GetComputerName(s$, sz) ... |
|||
:
Нравится:
Не нравится:
|
|||
24.12.2004, 13:48 |
|
|
start [/forum/topic.php?fid=61&msg=32836467&tid=2186330]: |
0ms |
get settings: |
10ms |
get forum list: |
14ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
55ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
47ms |
get tp. blocked users: |
1ms |
others: | 342ms |
total: | 484ms |
0 / 0 |