This is what I am trying to use:
enum COMPUTER_NAME_FORMAT
{
ComputerNameNetBIOS,
ComputerNameDnsHostname,
ComputerNameDnsDomain,
ComputerNameDnsFullyQualified,
ComputerNamePhysicalNetBIOS,
ComputerNamePhysicalDnsHostname,
ComputerNamePhysicalDnsDomain,
ComputerNamePhysicalDnsFullyQualified,
ComputerNameMax
}
static extern bool SetComputerNameEx( [In] COMPUTER_NAME_FORMAT NameType,
string lpBuffer );
Now this is the part I am not sure of, setting the computer name on a button
click using the value of textbox1.text:
private void button1_Click(object sender, System.EventArgs e)
{
myCName = textBox1.Text;
ComputerName.Form1.SetComputerNameEx(ComputerNameNetBIOS, myCName);
}
Am I even close on this?
Todd