using System; using System.Management; class program { public static void Main() { string WorkgroupName = "ECLASS"; ManagementObject manage = new ManagementObject(string.Format("Win32_ComputerSystem.Name='{0}'", Environment.MachineName)); object[] args = { WorkgroupName, null, null, null }; manage.InvokeMethod("JoinDomainOrWorkgroup", args); Console.WriteLine("Done! The Workgroup name will take effect after the next computer restart."); Console.ReadKey(); } }
沒有留言:
張貼留言