|
-
March 30th, 2001, 08:01 PM
#1
Getting Computer's Name
Please may someone let me know how I can get the computer's name in VB code.
Thanks
-
March 30th, 2001, 08:17 PM
#2
Re: Getting Computer's Name
In a module
option Explicit
Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (byval lpBuffer as string, nSize as Long) as Long
In a form
option Explicit
private Sub Form_Load()
Dim sComputer as string
Dim lpBuff as string * 1024
'get the Computer Name
GetComputerName lpBuff, len(lpBuff)
sComputer = Left$(lpBuff, (InStr(1, lpBuff, vbNullChar)) - 1)
lpBuff = ""
MsgBox "Computer Name: " & sComputer
End
End Sub
David Paulson
-
April 4th, 2001, 05:27 AM
#3
Re: Getting Computer's Name
Great. If the one who asked do not rate, I do.
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
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
|