找回密码
 加入
搜索
查看: 7206|回复: 9

[AU3基础] 宽带连接代码问题

  [复制链接]
发表于 2014-5-24 20:12:52 | 显示全部楼层 |阅读模式
本帖最后由 dnvplj 于 2014-5-28 12:30 编辑

请问各朋友,如何取消提示:
#Region
#PRE_icon=..\..\..\windows\system32\SHELL32.dll|-165
#PRE_UseX64=n
#PRE_Res_requestedExecutionLevel=None
#EndRegion
Opt("MustDeclareVars", 0x00000001)
_MAIN()
Exit
Func _MAIN()
        Local $I = MsgBox(0x00000004 + 0x00000020, "提示:", "是否创建宽带连接?")
        Local $RASPHONE = ""
        Switch @OSVersion
                Case "WIN_XP"
                        $RASPHONE = @AppDataCommonDir & "\Microsoft\Network\Connections\Pbk\rasphone.pbk"
                Case "WIN_7"
                        $RASPHONE = @AppDataDir & "\Microsoft\Network\Connections\Pbk\rasphone.pbk"
                Case Else
                        MsgBox(0x00000000 + 0x00000040, "提示:", "本工具不适用于本系统", 0x00000003)
                        Exit
        EndSwitch
        Switch $I
                Case 0x00000006
                        FileOpen($RASPHONE, 0x0000000A)
                        FileWrite($RASPHONE, RASPHONE_PBK())
                        FileWrite(@DesktopCommonDir & "\宽带连接.lnk", PPPOE())
                Case Else
                        Exit
        EndSwitch
EndFunc   ;==>_MAIN
Func PPPOE()
        If @OSVersion = "WIN_7" Then
                Local $FILEBIN = ""
                $FILEBIN &= "4C0000000114020000000000C0000000000000468100080000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000940114001F802020EC21EA3A6910A2DD08002B30309D1E00"
                $FILEBIN &= "718000000000000000000000C7AC07700232D111AAD200805FC1270E6001FF4E03000000FF5E0000D76A12BA6621D111B1D000805FC1270E254CF93345660941A9ED39AA79D671FE4E000000060000000000000034000000B4000000000000000A000000"
                $FILEBIN &= "0A0000002A00000000000000E800000002000000000000000000000000000000EA00000002000000BD5B265EDE8FA5630000570041004E0020004D0069006E00690070006F0072007400200028005000500050004F00450029000000140043003A005C00"
                $FILEBIN &= "550073006500720073005C007A00680061006E0067005C0041007000700044006100740061005C0052006F0061006D0069006E0067005C004D006900630072006F0073006F00660074005C004E006500740077006F0072006B005C0043006F006E006E00"
                $FILEBIN &= "65006300740069006F006E0073005C00500062006B005C00720061007300700068006F006E0065002E00700062006B000000254CF93345660941A9ED39AA79D671FE0000000005000000000000000000000000000000"
        Else
                Local $FILEBIN = ""
                $FILEBIN &= "4C0000000114020000000000C0000000000000468100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000B00114001F50E04FD020EA3A6910A2D808002B30309D1400"
                $FILEBIN &= "2E002020EC21EA3A6910A2DD08002B30309D14007000C7AC07700232D111AAD200805FC1270E7201FF4E02000000FF5E0F3800000000D76A12BA6621D111B1D000805FC1270E254CF93345660941A9ED39AA79D671FE5F04000006000000000000002C00"
                $FILEBIN &= "0000E0000000000000000A0000000A00000022000000000000000C01000002000000BD5B265EDE8FA5630000570041004E002000AE5F8B57EF7AE353200028005000500050004F00450029000000140043003A005C0044006F00630075006D0065006E00"
                $FILEBIN &= "74007300200061006E0064002000530065007400740069006E00670073005C0041006C006C002000550073006500720073005C004100700070006C00690063006100740069006F006E00200044006100740061005C004D006900630072006F0073006F00"
                $FILEBIN &= "660074005C004E006500740077006F0072006B005C0043006F006E006E0065006300740069006F006E0073005C00500062006B005C00720061007300700068006F006E0065002E00700062006B000000254CF93345660941A9ED39AA79D671FE01000000"
                $FILEBIN &= "050000000000180F000000000000"
        EndIf
        Return Binary("0x" & $FILEBIN)
EndFunc   ;==>PPPOE
Func RASPHONE_PBK()
        Local $FILEBIN = ""
        $FILEBIN &= "5BE5AEBDE5B8A6E8BF9EE68EA55D0D0A456E636F64696E673D310D0A547970653D350D0A4175746F4C6F676F6E3D300D0A55736552617343726564656E7469616C733D310D0A4469616C506172616D735549443D393532323635360D0A477569643D3235"
        $FILEBIN &= "3443463933333435363630393431413945443339414137394436373146450D0A4261736550726F746F636F6C3D310D0A56706E53747261746567793D300D0A4578636C7564656450726F746F636F6C733D300D0A4C6370457874656E73696F6E733D310D"
        $FILEBIN &= "0A44617461456E6372797074696F6E3D380D0A5377436F6D7072657373696F6E3D310D0A4E65676F74696174654D756C74696C696E6B416C776179733D300D0A536B69704E77635761726E696E673D300D0A536B6970446F776E4C6576656C4469616C6F"
        $FILEBIN &= "673D300D0A536B6970446F75626C654469616C4469616C6F673D300D0A4469616C4D6F64653D310D0A4469616C50657263656E743D37350D0A4469616C5365636F6E64733D3132300D0A48616E67557050657263656E743D31300D0A48616E6755705365"
        $FILEBIN &= "636F6E64733D3132300D0A4F76657272696465507265663D31350D0A52656469616C417474656D7074733D330D0A52656469616C5365636F6E64733D36300D0A49646C65446973636F6E6E6563745365636F6E64733D300D0A52656469616C4F6E4C696E"
        $FILEBIN &= "6B4661696C7572653D300D0A43616C6C6261636B4D6F64653D300D0A437573746F6D4469616C446C6C3D0D0A437573746F6D4469616C46756E633D0D0A437573746F6D5261734469616C446C6C3D0D0A41757468656E7469636174655365727665723D30"
        $FILEBIN &= "0D0A53686172654D7346696C655072696E743D300D0A42696E644D734E6574436C69656E743D300D0A53686172656450686F6E654E756D626572733D310D0A476C6F62616C44657669636553657474696E67733D300D0A50726572657175697369746545"
        $FILEBIN &= "6E7472793D0D0A50726572657175697369746550626B3D0D0A507265666572726564506F72743D5050506F45342D300D0A5072656665727265644465766963653D57414E20E5BEAEE59E8BE7ABAFE58FA320285050504F45290D0A507265666572726564"
        $FILEBIN &= "4270733D300D0A5072656665727265644877466C6F773D300D0A50726566657272656450726F746F636F6C3D300D0A507265666572726564436F6D7072657373696F6E3D300D0A507265666572726564537065616B65723D310D0A507265666572726564"
        $FILEBIN &= "4D646D50726F746F636F6C3D300D0A507265766965775573657250773D310D0A50726576696577446F6D61696E3D300D0A5072657669657750686F6E654E756D6265723D300D0A53686F774469616C696E6750726F67726573733D310D0A53686F774D6F"
        $FILEBIN &= "6E69746F7249636F6E496E5461736B4261723D310D0A437573746F6D417574684B65793D2D310D0A417574685265737472696374696F6E733D3633320D0A5479706963616C417574683D310D0A49705072696F726974697A6552656D6F74653D310D0A49"
        $FILEBIN &= "70486561646572436F6D7072657373696F6E3D310D0A4970416464726573733D302E302E302E300D0A4970446E73416464726573733D302E302E302E300D0A4970446E7332416464726573733D302E302E302E300D0A497057696E73416464726573733D"
        $FILEBIN &= "302E302E302E300D0A497057696E7332416464726573733D302E302E302E300D0A497041737369676E3D310D0A49704E616D6541737369676E3D310D0A49704672616D6553697A653D313030360D0A4970446E73466C6167733D300D0A49704E4254466C"
        $FILEBIN &= "6167733D310D0A54637057696E646F7753697A653D300D0A557365466C6167733D300D0A4970536563466C6167733D300D0A4970446E735375666669783D0D0A0D0A4E4554434F4D504F4E454E54533D0D0A6D735F7365727665723D300D0A6D735F6D73"
        $FILEBIN &= "636C69656E743D300D0A0D0A4D454449413D726173746170690D0A506F72743D5050506F45342D300D0A4465766963653D57414E20E5BEAEE59E8BE7ABAFE58FA320285050504F45290D0A0D0A4445564943453D5050506F450D0A4C61737453656C6563"
        $FILEBIN &= "74656450686F6E653D300D0A50726F6D6F7465416C7465726E617465733D300D0A5472794E657874416C7465726E6174654F6E4661696C3D310D0A0D0A"
        Return Binary("0x" & $FILEBIN)
EndFunc   ;==>RASPHONE_PBK

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2014-5-26 10:19:35 | 显示全部楼层
没人帮呢,自己顶一下。
 楼主| 发表于 2014-5-28 12:31:36 | 显示全部楼层
把这行删除出错
MsgBox(0x00000004 + 0x00000020, "提示:", "是否创建宽带连接?")
发表于 2014-5-28 13:16:33 | 显示全部楼层
本帖最后由 shqf 于 2014-5-28 13:17 编辑

出错的提示是什么 看了吗?关键在$i
 楼主| 发表于 2014-5-28 14:00:31 | 显示全部楼层
错误提示:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2014-5-28 15:37:01 | 显示全部楼层
#Region
#PRE_icon=..\..\..\windows\system32\SHELL32.dll|-165
#PRE_UseX64=n
#PRE_Res_requestedExecutionLevel=None
#EndRegion
Opt("MustDeclareVars", 0x00000001)
_MAIN()
Exit
Func _MAIN()
       ; Local $I = MsgBox(0x00000004 + 0x00000020, "提示:", "是否创建宽带连接?")
        Local $RASPHONE = ""
        Switch @OSVersion
                Case "WIN_XP"
                        $RASPHONE = @AppDataCommonDir & "\Microsoft\Network\Connections\Pbk\rasphone.pbk"
                Case "WIN_7"
                        $RASPHONE = @AppDataDir & "\Microsoft\Network\Connections\Pbk\rasphone.pbk"
                Case Else
                        MsgBox(0x00000000 + 0x00000040, "提示:", "本工具不适用于本系统", 0x00000003)
                        Exit
        EndSwitch
     ;   Switch $I
               ; Case 0x00000006
                        FileOpen($RASPHONE, 0x0000000A)
                        FileWrite($RASPHONE, RASPHONE_PBK())
                        FileWrite(@DesktopCommonDir & "\宽带连接.lnk", PPPOE())
               ; Case Else
                      ;  Exit
       ; EndSwitch
EndFunc   ;==>_MAIN
Func PPPOE()
        If @OSVersion = "WIN_7" Then
                Local $FILEBIN = ""
                $FILEBIN &= "4C0000000114020000000000C0000000000000468100080000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000940114001F802020EC21EA3A6910A2DD08002B30309D1E00"
                $FILEBIN &= "718000000000000000000000C7AC07700232D111AAD200805FC1270E6001FF4E03000000FF5E0000D76A12BA6621D111B1D000805FC1270E254CF93345660941A9ED39AA79D671FE4E000000060000000000000034000000B4000000000000000A000000"
                $FILEBIN &= "0A0000002A00000000000000E800000002000000000000000000000000000000EA00000002000000BD5B265EDE8FA5630000570041004E0020004D0069006E00690070006F0072007400200028005000500050004F00450029000000140043003A005C00"
                $FILEBIN &= "550073006500720073005C007A00680061006E0067005C0041007000700044006100740061005C0052006F0061006D0069006E0067005C004D006900630072006F0073006F00660074005C004E006500740077006F0072006B005C0043006F006E006E00"
                $FILEBIN &= "65006300740069006F006E0073005C00500062006B005C00720061007300700068006F006E0065002E00700062006B000000254CF93345660941A9ED39AA79D671FE0000000005000000000000000000000000000000"
        Else
                Local $FILEBIN = ""
                $FILEBIN &= "4C0000000114020000000000C0000000000000468100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000B00114001F50E04FD020EA3A6910A2D808002B30309D1400"
                $FILEBIN &= "2E002020EC21EA3A6910A2DD08002B30309D14007000C7AC07700232D111AAD200805FC1270E7201FF4E02000000FF5E0F3800000000D76A12BA6621D111B1D000805FC1270E254CF93345660941A9ED39AA79D671FE5F04000006000000000000002C00"
                $FILEBIN &= "0000E0000000000000000A0000000A00000022000000000000000C01000002000000BD5B265EDE8FA5630000570041004E002000AE5F8B57EF7AE353200028005000500050004F00450029000000140043003A005C0044006F00630075006D0065006E00"
                $FILEBIN &= "74007300200061006E0064002000530065007400740069006E00670073005C0041006C006C002000550073006500720073005C004100700070006C00690063006100740069006F006E00200044006100740061005C004D006900630072006F0073006F00"
                $FILEBIN &= "660074005C004E006500740077006F0072006B005C0043006F006E006E0065006300740069006F006E0073005C00500062006B005C00720061007300700068006F006E0065002E00700062006B000000254CF93345660941A9ED39AA79D671FE01000000"
                $FILEBIN &= "050000000000180F000000000000"
        EndIf
        Return Binary("0x" & $FILEBIN)
EndFunc   ;==>PPPOE
Func RASPHONE_PBK()
        Local $FILEBIN = ""
        $FILEBIN &= "5BE5AEBDE5B8A6E8BF9EE68EA55D0D0A456E636F64696E673D310D0A547970653D350D0A4175746F4C6F676F6E3D300D0A55736552617343726564656E7469616C733D310D0A4469616C506172616D735549443D393532323635360D0A477569643D3235"
        $FILEBIN &= "3443463933333435363630393431413945443339414137394436373146450D0A4261736550726F746F636F6C3D310D0A56706E53747261746567793D300D0A4578636C7564656450726F746F636F6C733D300D0A4C6370457874656E73696F6E733D310D"
        $FILEBIN &= "0A44617461456E6372797074696F6E3D380D0A5377436F6D7072657373696F6E3D310D0A4E65676F74696174654D756C74696C696E6B416C776179733D300D0A536B69704E77635761726E696E673D300D0A536B6970446F776E4C6576656C4469616C6F"
        $FILEBIN &= "673D300D0A536B6970446F75626C654469616C4469616C6F673D300D0A4469616C4D6F64653D310D0A4469616C50657263656E743D37350D0A4469616C5365636F6E64733D3132300D0A48616E67557050657263656E743D31300D0A48616E6755705365"
        $FILEBIN &= "636F6E64733D3132300D0A4F76657272696465507265663D31350D0A52656469616C417474656D7074733D330D0A52656469616C5365636F6E64733D36300D0A49646C65446973636F6E6E6563745365636F6E64733D300D0A52656469616C4F6E4C696E"
        $FILEBIN &= "6B4661696C7572653D300D0A43616C6C6261636B4D6F64653D300D0A437573746F6D4469616C446C6C3D0D0A437573746F6D4469616C46756E633D0D0A437573746F6D5261734469616C446C6C3D0D0A41757468656E7469636174655365727665723D30"
        $FILEBIN &= "0D0A53686172654D7346696C655072696E743D300D0A42696E644D734E6574436C69656E743D300D0A53686172656450686F6E654E756D626572733D310D0A476C6F62616C44657669636553657474696E67733D300D0A50726572657175697369746545"
        $FILEBIN &= "6E7472793D0D0A50726572657175697369746550626B3D0D0A507265666572726564506F72743D5050506F45342D300D0A5072656665727265644465766963653D57414E20E5BEAEE59E8BE7ABAFE58FA320285050504F45290D0A507265666572726564"
        $FILEBIN &= "4270733D300D0A5072656665727265644877466C6F773D300D0A50726566657272656450726F746F636F6C3D300D0A507265666572726564436F6D7072657373696F6E3D300D0A507265666572726564537065616B65723D310D0A507265666572726564"
        $FILEBIN &= "4D646D50726F746F636F6C3D300D0A507265766965775573657250773D310D0A50726576696577446F6D61696E3D300D0A5072657669657750686F6E654E756D6265723D300D0A53686F774469616C696E6750726F67726573733D310D0A53686F774D6F"
        $FILEBIN &= "6E69746F7249636F6E496E5461736B4261723D310D0A437573746F6D417574684B65793D2D310D0A417574685265737472696374696F6E733D3633320D0A5479706963616C417574683D310D0A49705072696F726974697A6552656D6F74653D310D0A49"
        $FILEBIN &= "70486561646572436F6D7072657373696F6E3D310D0A4970416464726573733D302E302E302E300D0A4970446E73416464726573733D302E302E302E300D0A4970446E7332416464726573733D302E302E302E300D0A497057696E73416464726573733D"
        $FILEBIN &= "302E302E302E300D0A497057696E7332416464726573733D302E302E302E300D0A497041737369676E3D310D0A49704E616D6541737369676E3D310D0A49704672616D6553697A653D313030360D0A4970446E73466C6167733D300D0A49704E4254466C"
        $FILEBIN &= "6167733D310D0A54637057696E646F7753697A653D300D0A557365466C6167733D300D0A4970536563466C6167733D300D0A4970446E735375666669783D0D0A0D0A4E4554434F4D504F4E454E54533D0D0A6D735F7365727665723D300D0A6D735F6D73"
        $FILEBIN &= "636C69656E743D300D0A0D0A4D454449413D726173746170690D0A506F72743D5050506F45342D300D0A4465766963653D57414E20E5BEAEE59E8BE7ABAFE58FA320285050504F45290D0A0D0A4445564943453D5050506F450D0A4C61737453656C6563"
        $FILEBIN &= "74656450686F6E653D300D0A50726F6D6F7465416C7465726E617465733D300D0A5472794E657874416C7465726E6174654F6E4661696C3D310D0A0D0A"
        Return Binary("0x" & $FILEBIN)
EndFunc   ;==>RASPHONE_PBK
试下能成功吗!!!
 楼主| 发表于 2014-5-28 16:50:11 | 显示全部楼层
问题解决,但有一个问题,见下图。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2014-5-28 22:30:34 | 显示全部楼层
请求管理员 试下  开头加上   #RequireAdmin
 楼主| 发表于 2014-5-30 08:23:12 | 显示全部楼层
加了,不起作用。
发表于 2014-5-30 23:13:12 | 显示全部楼层
宽带连接的 原代码  论坛里面 有很多 你自己搜索一下
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-15 14:42 , Processed in 0.078409 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表