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
A function which uses the GetComputerName Win32 AP...
Author:
Zack Nealson
E-mail:
Click to e-mail author
Submitted:
4/11/2000
Version:
VB5
Compatibility:
VB5, VB6
Category:
Windows API
Views:
22754
A function which uses the GetComputerName Win32 API to return the name of the local computer.
Declarations:
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Code:
Function ComputerName() As String Dim buffer As String * 512, length As Long length = Len(buffer) 'GetComputerName returns zero on failure If GetComputerName(buffer, length) Then ComputerName = Left$(buffer, length) End If End Function
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement