Programmatically detect system-proxy settings on Windows XP with Python

前端 未结 2 1057
遥遥无期
遥遥无期 2021-01-01 04:32

I develop a critical application used by a multi-national company. Users in offices all around the globe need to be able to install this application.

The application

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-01 04:51

    As far as I know, In a Windows environment, if no proxy environment variables are set, proxy settings are obtained from the registry's Internet Settings section. . Isn't it enough?

    Or u can get something useful info from registry: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer

    Edit:
    sorry for don't know how to format comment's source code, I repost it here.

    >>> import win32com.client
    >>> js = win32com.client.Dispatch('MSScriptControl.ScriptControl')
    >>> js.Language = 'JavaScript'
    >>> js.AddCode('function add(a, b) {return a+b;}')
    >>> js.Run('add', 1, 2)
    3
    

提交回复
热议问题