如何设置“自动配置脚本”的拨号连接编程?脚本、如何设置、拨号连接

2023-09-04 22:59:33 作者:学不会°淑女范

我在Internet选项一个拨号连接 - >连接,我想为它编程设置一个自动配置脚本(的连接的设置之一)。设置它的局域网是容易的,但我无法找到有关设置它为其它连接任何东西。

I have a dial-up connection in 'Internet Options' -> 'Connections' and I would like to set an 'automatic configuration script' (one of the connection's settings) for it programmatically. Setting it for LAN is easy but I can't find anything about setting it for other connections.

推荐答案

好了,所以我已经设法解决这个问题。实际上它被存储在注册表中的相同方式LAN设置的存储位置。对于局域网解决方案来自这里但我会贴它的情况下,它消失的一天。

Ok so I've managed to solve it. Actually it is stored in the registry in the same way LAN settings are stored. The solution for LAN comes from here but I will paste it in case it disappears some day.

HKEY_CURRENT_USER \软件\微软\的Windows \ CurrentVersion \ Internet设置\连接注册表项的对于在Internet选项中定义的所有连接和LAN设置太值(DefaultConnectionSettings是LAN) 。该值是字节数组,这里是每一个字节的描述: 1)字节数为零总是有一个32或46 - 我无法找到这个byte.The接下来的三个字节是零的更多信息 2)字节数4所使用的Internet选项属性页(互联网Explorer的 - >工具 - > Internet选项...)的计数器。 当你手动更改设置互联网(比如在连接选项卡局域网设置),该计数器increments.Its不byte.But它必须有非常有用的一个value.I保持零always.The接下来的三个字节是零(字节5到7)。 3)字节数8可以采取不同的值,根据您的设​​置。 的值是: 09只有当自动检测设置被启用 03时,只有'使用代理服务器为LAN已启用 0B时,同时启用 05时,只有使用自动配置脚本启用 0D自动检测设置何时使用自动配置脚本启用 07时,使用代理服务器为LAN和使用自动配置脚本启用 0F当所有这三个启用。 01时,他们没有被启用。 接下来的三个字节是零(字节9至B)。 的 4)字节编号C(十进制12)包含代理服务器address.For例的代理服务器的127.0.0.1:80'的长度已长度12(长度包括点和结肠) 。接下来的三个字节是零(字节D钮F)。 5)字节10(或十进制16),包含代理服务器地址 - 像'127.0.0.1:80(其中80显然是端口号) 6)地址后字节immediatley另外,则为information.The的长度,接下来的三个字节是零。 例如,如果不使用代理服务器对于本地地址被选中,那么这个字节是07,接下来的三个字节是零,然后来到一个字符串,即(表明您绕过代理server.Now因为有7个字符中,长度为07!)。 你将不得不尝试在自己的工作找到更多关于这一点。 如果你没有任何其他信息则长度为0,没有信息被添加。 7)后的附加信息字节,是自动配置脚本地址的长度(如果你没有,那么你不需要添加任何东西,请跳过此步骤并转到步骤8脚本地址) 。接下来的三个字节是零,然后是地址。 8)最后,32零追加。(我不知道为什么!)

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections registry key has values for all connections that are defined in 'Internet Options' and for LAN settings too (DefaultConnectionSettings is for LAN). The values are byte arrays and here is the description of every byte: 1) Byte number zero always has a 3C or 46 - I couldnt find more information about this byte.The next three bytes are zeros. 2) Byte number 4 is a counter used by the 'Internet Options' property sheet (Internet explorer->Tools->Internet Options...). As you manually change the internet setting (such as LAN settings in the Connections tab), this counter increments.Its not very useful byte.But it MUST have a value.I keep it zero always.The next three bytes are zeros (Bytes 5 to 7). 3) Byte number 8 can take different values as per your settings. The value is : 09 when only 'Automatically detect settings' is enabled 03 when only 'Use a proxy server for your LAN' is enabled 0B when both are enabled 05 when only 'Use automatic configuration script' is enabled 0D when 'Automatically detect settings' and 'Use automatic configuration script' are enabled 07 when 'Use a proxy server for your LAN' and 'Use automatic configuration script' are enabled 0F when all the three are enabled. 01 when none of them are enabled. The next three bytes are zeros (Bytes 9 to B). 4) Byte number C (12 in decimal) contains the length of the proxy server address.For example a proxy server '127.0.0.1:80' has length 12 (length includes the dots and the colon).The next three bytes are zeros (Bytes D to F). 5) Byte 10 (or 16 in decimal) contains the proxy server address - like '127.0.0.1:80' (where 80 is obviously the port number) 6) the byte immediatley after the address contians the length of additional information.The next three bytes are zeros. For example if the 'Bypass proxy server for local addresses' is ticked, then this byte is 07,the next three bytes are zeros and then comes a string i.e. '' ( indicates that you are bypassing the proxy server.Now since has 7 characters, the length is 07!). You will have to experiment on your own for finding more about this. If you dont have any additional info then the length is 0 and no information is added. 7) The byte immediately after the additional info, is the length of the automatic configuration script address (If you dont have a script address then you dont need to add anything,skip this step and goto step 8).The next three bytes are zeros,then comes the address. 8) Finally, 32 zeros are appended.(I dont know why!)