TIME_OF_DAY_INFO *m_time;
WCHAR wszServername[256];
DWORD err;
if(sServerName!=NULL)
{
// 普通字符串转换成Unicode字符串
MultiByteToWideChar( CP_ACP, 0, sServerName,
strlen(sServerName)+1, wszServername, sizeof(wszServername)/sizeof(wszServername[0]) );
// 得到服务器时间
err=NetRemoteTOD(wszServername,(LPBYTE *)&m_time);
}
else
err=NetRemoteTOD(NULL,(LPBYTE *)&m_time);
if(err!=0)
return 0;
else
return m_time->tod_elapsedt;