You can set your computer's name using the
SetComputerName function, which is available in
kernel32.dll:
//Code
using System.Runtime.InteropServices;
[DllImport("kernel32.dll")]
static extern bool SetComputerName(string lpComputerName);
bool status = SetComputerName("MyDen");