|
-
November 12th, 1999, 11:20 AM
#1
Grabbing Computer Name
How can I grab the computer name? As in the name Netbios would give the system.
-
November 12th, 1999, 06:50 PM
#2
Re: Grabbing Computer Name
copy paste the code in a new application
option Explicit
private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (byval lpBuffer as string, nSize as Long) as Long
private Sub Command1_Click()
Dim ret as Long
Dim buff as string
buff = Space(255)
ret = GetComputerName(buff, 255)
MsgBox buff
End Sub
-
November 15th, 1999, 06:31 AM
#3
Re: Grabbing Computer Name
Use API's:
For instance toget computer name
use GetComputerName function.
Similarly if want to get hold of the current user name then use API
GetUserName.
Use VB Application wizard to get to see how to use these calls as the wizard
automatically generates the code for you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|