HostName Property

The Domain Name of an Internet host. When set, it initiates a search for the corresponding address(es).

Syntax

ANSI (Cross Platform)
char* GetHostName();
int SetHostName(const char* lpszHostName); Unicode (Windows) LPWSTR GetHostName();
INT SetHostName(LPCWSTR lpszHostName);
@property (nonatomic,readwrite,assign,getter=hostName,setter=setHostName:) NSString* hostName;
- (NSString*)hostName;
- (void)setHostName:(NSString*)newHostName;
#define PID_IPINFO_HOSTNAME 32

IPWORKS_EXTERNAL void* IPWORKS_CALL IPWorks_IPInfo_Get(void *lpObj, int propid, int arridx, int *lpcbVal, int64 *lpllVal);
IPWORKS_EXTERNAL int IPWORKS_CALL IPWorks_IPInfo_Set(void *lpObj, int propid, int arridx, const void *val, int cbVal);

Default Value

""

Remarks

This property contains the domain name of the host whose IP address is specified by HostAddress.

If this property is set to a domain name, a search is initiated for the corresponding host address(s).

The RequestComplete event is fired when the search is complete. The RequestId property identifies the pending request.

Example (Resolve a Name)


IPInfoControl.HostName = "MyHostName"
While IPInfoControl.PendingRequests > 0
    IPInfoControl.DoEvents()
End While
ResolvedAddress = IPInfoControl.HostAddress

Data Type

String

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks 2020 C++ Edition - Version 20.0 [Build 8307]