Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Display Computer Name
Author:
Vicky (VJ)
E-mail:
Click to e-mail author
Submitted:
12/17/2004
Version:
VB5
Compatibility:
VB5, VB6
Category:
Windows API
Views:
30476
Display your computer name.
Declarations:
'none
Code:
Add A Module And Enter: Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long Private Sub Command1_Click() Dim strBuffer As String Dim lngBufSize As Long Dim lngStatus As Long lngBufSize = 255 strBuffer = String$(lngBufSize, " ") lngStatus = GetComputerName(strBuffer, lngBufSize) If lngStatus <> 0 Then MsgBox ("Computer name is: " & Left(strBuffer, lngBufSize)) End If End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement