How do I get the local machine name?
You should be able to use System.Environment.MachineName for this. It is a property that returns a string containing the netBIOS name of the computer:
System.Environment.MachineName
http://msdn.microsoft.com/en-us/library/system.environment.machinename.aspx