@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: Sets a NetBIOS or DNS name for the local computer. !!!!C# Signature: [DllImport("kernel32.dll", SetLastError=true, CharSet=CharSet.Auto)] static extern bool SetComputerNameEx(COMPUTER_NAME_FORMAT NameType, string lpBuffer); !!!!User-Defined Types: [COMPUTER_NAME_FORMAT] !!!!Notes: None. !!!!Tips & Tricks: Please add some! !!!!Sample Code: public class renamefull { [DllImport("kernel32.dll", CharSet = CharSet.Auto)] static extern bool SetComputerNameEx(COMPUTER_NAME_FORMAT NameType, string lpBuffer); enum COMPUTER_NAME_FORMAT { ComputerNameNetBIOS, ComputerNameDnsHostname, ComputerNameDnsDomain, ComputerNameDnsFullyQualified, ComputerNamePhysicalNetBIOS, ComputerNamePhysicalDnsHostname, ComputerNamePhysicalDnsDomain, ComputerNamePhysicalDnsFullyQualified, } //ComputerNamePhysicalDnsHostname used to rename the computer name and netbios name before domain join public static bool fullrename(string name) { try { return SetComputerNameEx(COMPUTER_NAME_FORMAT.ComputerNamePhysicalDnsHostname, name); } catch (Exception) { return false; } } } !!!!Alternative Managed API: Do you know one? Please contribute it! Documentation: SetComputerNameEx@msdn on MSDN
Edit kernel32.SetCompu...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.