' Usage
Dim value As String = My.Computer.Name
' Declaration
Public ReadOnly Property Name As String
A String containing the name of the computer.
The My.Computer.Name property provides functionality similar to the MachineName property.
This example uses the My.Computer.Name property to display the name of the computer on which the code runs.
MsgBox("Computer name: " & My.Computer.Name)
Namespace: Microsoft.VisualBasic.Devices
Class: Computer, ServerComputer
Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)
Availability by Project Type
Project type | Available |
|---|
Windows Application | Yes |
Class Library | Yes |
Console Application | Yes |
Windows Control Library | Yes |
Web Control Library | Yes |
Windows Service | Yes |
Web Site | Yes |
No permissions are required.
Reference