Let’s say you’re on a computer with which you need a website on a server to have information about. First, you want the computer name you’re on. In my case, I ran the page on the website from a remote computer and I needed a textbox to default to the computer name where I was. It’s very simple. The code is:

string[] computer_name = 
    HostName.Split(new Char[] { '.' });
txtWorkStation.Text = computer_name[0].ToString();

(I have it on multiple lines due to space constraints here. There are only 2 lines. The one starting with ‘txtWorkStation.Text=’ starts the second line.)