VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



CurComputerName

by MAGiC MANiAC^mTo (7 Submissions)
Category: String Manipulation
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (2 Votes)

Get the current computername from Windows

Inputs
sTmp1$ = CurComputerName()
Code Returns
( The current computername from Windows ) sTmp1$ = "MORTAL OBSESSiON"

Rate CurComputerName

' Get the current computername from Windows
' Coded By MAGiC MANiAC^mTo
' More Examples At: http://home.kabelfoon.nl/~mto/
'
Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" _ (ByVal lpBuffer$, nSize As Long) As Long
Function CurComputerName$()
 Dim sTmp1$
 sTmp1 = Space$(512)
 GetComputerName sTmp1, Len(sTmp1)
 CurComputerName = Trim$(sTmp1)
End Function

Download this snippet    Add to My Saved Code

CurComputerName Comments

No comments have been posted about CurComputerName. Why not be the first to post a comment about CurComputerName.

Post your comment

Subject:
Message:
0/1000 characters