How to get the Computer Name on which the code is running?

This will return the information of the server computer, not the client browser computer.
Add reference to System.Windows.Forms.dll.

VB.NET

Response.Write(System.Windows.Forms.SystemInformation.ComputerName)

C#

Response.Write(System.Windows.Forms.SystemInformation.ComputerName);