[DllImport("kernel32.dll")]
static extern bool SetComputerName(string lpComputerName);
None.
<DllImport("kernel32.dll")> _
Private Shared Function SetComputerName(ByVal lpComputerName As String) As Boolean
End Function
None.
You need to restart your computer for the new computer name to take effect.
Please add some!
using System.Runtime.InteropServices;
class Program
{
[DllImport("kernel32.dll")]
static extern bool SetComputerName(string lpComputerName);
static void Main(string[] args)
{
bool done = SetComputerName("New Comp Name");
if (done)
{
Console.WriteLine("Done");
}
Console.ReadKey();
}
}
Imports System.Runtime.InteropServices
Class Program
<DllImport("kernel32.dll")> _
Private Function SetComputerName(ByVal lpComputerName As String) As Boolean
End Function
Private Shared Sub Main(args As String())
Dim done As Boolean = SetComputerName("New Comp Name")
If done Then
Console.WriteLine("Done")
End If
Console.ReadKey()
End Sub
End Class
Do you know one? Please contribute it!
http://msdn2.microsoft.com/en-us/library/ms724930.aspx