///////////////////////////////////////////
// port.cppÎļþ
#include
#include
#include <windows.h>
#include
using namespace std;
//typedef unsigned char byte;
int main()
{
HKEY hKey;
LONG lRet = ::RegOpenKeyExW(HKEY_LOCAL_MACHINE,L"SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp",0,KEY_QUERY_VALUE, &hKey);
if(lRet != ERROR_SUCCESS)
{
printf(" failed ");
return 0;
}
else
{
printf("Terminal Server(Ô¶³Ì×ÀÃæ)¶Ë¿ÚΪ:");
DWORD port,Length;
long ret1=::RegQueryValueExW(hKey, L"PortNumber", 0, 0, (unsigned char*)&port, &Length);
//cout <
}
::RegCloseKey(hKey);
getchar();
return 0;
}