A | B | C |  D | E | F |  G | H | I |  J | K | L |  M | N | O |  P | Q | R |  S | T | U |  V | W | X |  Y | Z



gethostname

The Windows Sockets gethostname function returns the standard host name for the local machine.

VB4-32,5,6
Declare Function gethostname Lib "WSOCK32" (ByVal szHost As String, ByVal dwHostLen As Long) As Long

VB.NET
System.Net.Dns.GetHostName

Operating Systems Supported
Requires Windows Sockets 1.1 or later

Library
Wsock32

Parameter Information
- name
[out] A pointer to a buffer that receives the local host name.

- namelen
[in] The length of the buffer.

Return Values
If no error occurs, gethostname returns zero. Otherwise, it returns SOCKET_ERROR and a specific error code can be retrieved by calling WSAGetLastError.

Last update: 07 April 2006