gethostname

[DllImport("ws2_32.dll", SetLastError = true)]
public static extern int gethostname(
   byte[] name,
   int namelen
);

Microsoft documentation: Link

Last updated