Set the Computer’s Name Through .NET

You can set your computer’s name using the SetComputerName function, which is available in kernel32.dll:

//Codeusing System.Runtime.InteropServices; [DllImport("kernel32.dll")] static extern bool SetComputerName(string lpComputerName); bool status = SetComputerName("MyDen"); 
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: