Get Computer Name in VB v1.0
Submitted By:
harikuttan78
Rating:





(
Rate It)
Used one API call GetComputerName This is simple project i
declared a public function in a module and it calls in a
command button click procedure it will show your computer name
in a message box try this programme and let me know if there is
any other easy way to get computer name & server name
NOTE: Some downloads must be obtained through publishers´s site.
Do you want to get your software listed on this site? Go to our
submissions area.
Screenshot
Details
Number of downloads:
5437
Comments (5)
very good




Posted on Monday, July 14, 2003
very good
Sweeet




Posted by: Andries on Friday, July 18, 2003
This is just the link I was looking for.
A small, powerfull program...
Very good code (short and usefull)




Posted on Wednesday, August 20, 2003
The code was usefull to develop an application, i was able to doit by ASP, but this application needs to run on a pc.
Thank's for the code
Example was nice, but needs improvement




Posted by: Brian on Wednesday, September 24, 2003
Even with the Trim statment, the computer name will have a trailing NullChar.
This how I implemented the api call:
Public Declare Function GetComputerName Lib "kernel32" Alias _
"GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
' ------------------------------
' GetCompName
' Gets the computer network name.
' ------------------------------
Private Function GetCompName() As String
Dim sBuffer As String
Dim sComputerName As String
Dim lReturn As Long
sBuffer = Space(255)
lReturn = GetComputerName(sBuffer, Len(sBuffer))
sComputerName = Left$(sBuffer, InStr(sBuffer, vbNullChar) - 1)
GetCompName = Trim$(sComputerName)
End Function
CO




Posted by: Henry Aviles on Wednesday, October 15, 2003
Short and to the point, And i found it with the first hit on google.
Add Your Rating