#ifndef _WININET_INTERNETSETTINGS_HPP_ #define _WININET_INTERNETSETTINGS_HPP_ #ifndef _COMMON_STRING_HPP_ #include #endif #ifndef _COMMON_REGKEY_HPP_ #include #endif class InternetSettings { public: InternetSettings(); virtual ~InternetSettings(); bool getProxyEnable(void)const; const String &getUserAgent(void)const; const String &getAutoConfigProxy(void)const; const String &getProxyServer(void)const; const String &getAutoConfigURL(void)const; private: bool mProxyEnable; String mUserAgent; String mAutoConfigProxy; String mProxyServer; String mAutoConfigURL; }; inline InternetSettings::InternetSettings() { RegKey regKey(RegKey::CurrentUser); DWORD proxyEnable; proxyEnable=0; if(!regKey.openKey("software\\microsoft\\windows\\currentversion\\Internet Settings"))return; regKey.queryValue("ProxyServer",mProxyServer); regKey.queryValue("User Agent",mUserAgent); regKey.queryValue("AutoConfigProxy",mAutoConfigProxy); regKey.queryValue("AutoConfigURL",mAutoConfigURL); regKey.queryValue("ProxyEnable",proxyEnable); mProxyEnable=proxyEnable?true:false; } inline InternetSettings::~InternetSettings() { } inline bool InternetSettings::getProxyEnable(void)const { return mProxyEnable; } inline const String &InternetSettings::getUserAgent(void)const { return mUserAgent; } inline const String &InternetSettings::getAutoConfigProxy(void)const { return mAutoConfigProxy; } inline const String &InternetSettings::getProxyServer(void)const { return mProxyServer; } inline const String &InternetSettings::getAutoConfigURL(void)const { return mAutoConfigURL; } #endif