[DllImport("kernel32", CharSet=CharSet.Unicode)]
static extern bool GetComputerName(string lpBuffer, ref int lpnSize);
None.
The GetComputerName function retrieves the NetBIOS name of the local computer. This name is established at system startup, when the system reads it from the registry.
There is a .net class for this.
This is a rather sloppy ghetto hack on how to do this in C#. I suggest you don't really do it this way. Just use System.Environment.Maching in the framework.
class Class1
{
[DllImport("kernel32", CharSet=CharSet.Unicode)]
static extern bool GetComputerName(string name, ref int len);
[STAThread]
static void Main(string[] args)
{
String computerName="abcdefghijklmnopqrstuvwxyz";
int len = 100;
GetComputerName(computerName, ref len);
Console.WriteLine(computerName.Substring(0,len));
}
}
System.Environment.MachineName will get you the netbios name.