faint~~~~~我再push

解决方案 »

  1.   

    能说说详细的实现方法吗?在Win98下我用读取注册表的方法可以实现,但是Win2000下不行:(
    Win2000下涉及到SID的问题有人知道吗?
      

  2.   

    试试这个:(函数名长了点^_^)void CTEMPDlg::GetLocalProxyServerAddress() 
    {
    HKEY hKey = NULL;
    LONG lResult;
    DWORD dwSize,dwType;
    char szSubKey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings";
    char szKeyName[] = "ProxyServer";
    char szKeyValue[MAX_PATH]; lResult = RegOpenKeyEx(HKEY_CURRENT_USER, 
    szSubKey, 
    0,
    KEY_ALL_ACCESS, 
    &hKey);
    if (lResult != ERROR_SUCCESS)
    {
    return;
    }

    dwSize = MAX_PATH;
    lResult = RegQueryValueEx(hKey, 
    szKeyName, 
    NULL, 
    &dwType, 
    NULL, 
    &dwSize);
    if (lResult != ERROR_SUCCESS)
    {
    return;
    }

    //dwSize = 256;
    lResult = RegQueryValueEx(hKey, 
    szKeyName, 
    NULL, 
    &dwType,
    (LPBYTE)szKeyValue, 
    &dwSize);
    if (lResult != ERROR_SUCCESS)
    {
    return;
    }
    AfxMessageBox(szKeyValue);
    }
      

  3.   

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
    下面有ProxyServer键读取此键值就能得到当前代理服务器的值(具体方法请参考Congy(少侠)的代码)
    此结构Win98和Win2000相同