一、注册表方式
BOOL GetProxyServer(OUT LPSTR lpHostName_, OUT int& nport_)
{
DWORD _dwProxyEnable = 0;
QKPlugin_GetRegistryDw(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"), _T("ProxyEnable"), _dwProxyEnable);
if (!_dwProxyEnable)
return FALSE;
CString _strProxyServer = QKPlugin_GetRegistryStr(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"), _T("ProxyServer"));
_strProxyServer.MakeLower();
int _nhttpleng = -1;
_nhttpleng = _strProxyServer.Find(_T("http="));
// 格式解析 ftp=127.0.0.1:10001;gopher=127.0.0.1:10001;http=127.0.0.1:10001;https=127.0.0.1:10001;socks=127.0.0.1:10002;lq=1
if (_nhttpleng != -1)
{
_strProxyServer = _strProxyServer.Right(_strProxyServer.GetLength() - _nhttpleng - strlen("http="));
if (_strProxyServer.Find(_T(";")) != -1)
_strProxyServer = _strProxyServer.Left(_strProxyServer.Find(_T(";")));
int _x1 = 0, _x2 = 0, _x3 = 0, _

最低0.47元/天 解锁文章
3252

被折叠的 条评论
为什么被折叠?



