Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

US Job listings




   Misc

   Amazon

   Links

    


Displays the computer name

 

 'Displays the computer name . Place a command button on a form

Private 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

 

 

 

 

 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
Does a directory exist(VBNet)
Starfield(Pascal)
Random URLs(PHP)
Open/Close CD door example(VB)
web safe color palette(Javascript)
Enum example(C++)
This program deletes a folder(VB)
Previous page button(Javascript)

    




Copyright © 2003 by programmershelp.co.uk