//设置主机名
int nam;
char* setname = "WindowsCE";
nam = sethostname(setname, 10);
If no error occurs, this function (sethostname) returns zero.
//读取主机名
char HostName[30];
int HostNameBufLen = 30;
gethostname(HostName,HostNameBufLen);
gethostname 函数成功同样返回0.