Sunday, 17 February 2008

get computer name



Get Computer Name

Get Computer Name / Get User Name

Environ$ can be used to retrieve information from an operating system

environment variable

Sub Get_Environmental_Variable()

Dim sHostName As String

Dim sUserName As String

' Get Host Name / Get Computer Name

sHostName = Environ$("computername")

' Get Current User Name

sUserName = Environ$("username")

End Sub

In Dot Net it can be achieved by


No comments: