gethostname (ws2_32)
Last changed: -195.239.40.208

.
Summary
get standard host name for the local machine

C# Signature:

[DllImport("ws2_32.dll", SetLastError=true)]
static extern WSAReturnCode gethostname(StringBuilder name, int length);

User-Defined Types:

enum WSAReturnCode {
    /// <summary>
    /// The name parameter is not a valid part of the user address space, or the buffer size specified by the namelen parameter is too small to hold the complete host name, or bad address..
    /// </summary>
    Fault = 10014,
    /// <summary>
    /// A blocking Winsock call is in progress, or the service provider is still processing a callback function.
    /// </summary>
    InProgress = 10036,
    /// <summary>
    /// Network is down
    /// </summary>
    NetDown  = 10050,
    /// <summary>
    /// A successful WSAStartup call must occur before using this function.
    /// </summary>
    NotInitialised = 10093,
}

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Documentation