Cộng đồng AutoIT Việt - Autoitviet.forumvi.com
Chào mừng bạn đến với cộng đồng AutoIT Việt, hãy đăng ký một nick để cùng tham gia thảo luận nhé ^^!

Join the forum, it's quick and easy

Cộng đồng AutoIT Việt - Autoitviet.forumvi.com
Chào mừng bạn đến với cộng đồng AutoIT Việt, hãy đăng ký một nick để cùng tham gia thảo luận nhé ^^!
Cộng đồng AutoIT Việt - Autoitviet.forumvi.com
Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.
Latest topics
» [Code] Kiểm tra kết nối mạng
by jameseshell Fri Jul 31, 2015 3:29 pm

» AutoClick không chiếm chuột
by jameseshell Fri Jul 31, 2015 9:58 am

» [Sorf] Connect/Disconet Button
by thanhhan31 Fri Jun 26, 2015 3:56 am

» Giới thiệu ngôn ngữ lập trình Autoit
by vanhoa1402 Mon Jun 08, 2015 12:40 am

» [Code] Đếm ngược thời gian
by satoh290801 Sat Jun 06, 2015 10:11 am

» Debug game online
by cheater Mon Jun 01, 2015 3:15 pm

» [Thắc Mắc] cách nhập xuất dữ liệu
by cadilacst Mon Apr 27, 2015 7:14 am

» [Code] Auto Win 2c6f td1 - sv HN
by Hades Wed Jan 14, 2015 5:41 am

» [Hỏi] AutoIt với CSDL online?
by todzin Wed Nov 19, 2014 11:14 pm

» [Hỏi] Một số vấn đề về Copy & Paste file bằng ứng dụng thứ 3 (Everything.exe)
by aloatiso Tue Nov 11, 2014 10:31 pm

» Click theo điểm ảnh !
by nhatdaica055 Wed Oct 15, 2014 5:17 pm

» Nội quy diễn đàn
by lethusinh01 Fri Sep 12, 2014 3:59 am

» Hide Windows !!!
by Sweetsica Fri Aug 08, 2014 2:31 am

» Cài đặt , sử dụng và biên dịch Autoit
by mankichi Thu Jul 24, 2014 5:11 am

» Tuyển mod cho diễn đàn
by huynhlamid Fri Jan 17, 2014 3:36 pm

» PixelSearch - Quét (hay kiểm tra) điểm ảnh
by vanthang Fri Jan 17, 2014 5:49 am

» Thiệp Cực Đẹp Tặng Người Yêu !!!
by Nokia3G Mon Dec 23, 2013 12:50 pm

» Lấy đường dẫn của phần mềm chạy ngầm
by cuongkoken Sat Dec 21, 2013 1:25 am

» Xin Admin giup do
by xlove_bmt Wed Dec 18, 2013 6:40 am

» [Hỏi] Cần pro chỉ làm trainer game!
by quytucaca Wed May 29, 2013 7:43 am


Code thay đổi DSN

Go down

Code thay đổi DSN Empty Code thay đổi DSN

Bài gửi by Admin Mon Dec 17, 2012 2:50 am

Code:
#include <GUIConstantsEx.au3>    ;thu vien cua GUI
#include <Process.au3>
#NoTrayIcon
$size = 10;
$font = "Arial"
$attribute = 3; [optional] To define italic:2 underlined:4 strike:8 char format (add together the values of all the styles required, 2+4 = italic and underlined).


$gui = GUICreate("Change DNS", 400, 400)    ;Tao GUI

$btnGoogle = GUICtrlCreateButton("Google DNS", 20, 20, 70, 25)      ;tao nut button
$btnDefault = GUICtrlCreateButton("DNS Default", 20, 55, 70, 25)      ;tao nut button
$btnComodoDNS = GUICtrlCreateButton("Comdo DNS", 20, 90, 70, 25)      ;tao nut button
$btnAdvantage = GUICtrlCreateButton("Advantage", 20, 125, 70, 25)      ;tao nut button
$btnOpenDNS = GUICtrlCreateButton("Open DNS", 20, 160, 70, 25)      ;tao nut button
$btnUltraDNS = GUICtrlCreateButton("Ultra DNS", 20, 195, 70, 25)      ;tao nut button
$btnlevel3 = GUICtrlCreateButton("Level 3", 20, 230, 70, 25)
$btnOpenNIC = GUICtrlCreateButton("Open NIC", 20, 265, 70, 25)
$btnDNS8 = GUICtrlCreateButton("DNS 8", 20, 300, 70, 25)

$btnDNS9 = GUICtrlCreateButton("DNS 9", 155, 20, 70, 25)
$btnDNS10 = GUICtrlCreateButton("DNS 10", 155, 55, 70, 25)
$btnDNS11 = GUICtrlCreateButton("DNS 11", 155, 90, 70, 25)
$btnDNS12 = GUICtrlCreateButton("DNS 12", 155, 125, 70, 25)
$btnDNS13 = GUICtrlCreateButton("DNS 13", 155, 160, 70, 25)
$btnDNS14 = GUICtrlCreateButton("DNS 14", 155, 195, 70, 25)
$btnDNS15 = GUICtrlCreateButton("DNS 15", 155, 230, 70, 25)
$btnDNS16 = GUICtrlCreateButton("DNS 16", 155, 265, 70, 25)

GUICtrlCreateLabel("zolamua.com - nguyenthienanit@gmail.com - 01678.115.292",20,0,400,20);
GUICtrlSetFont(-1, $size, 400, $attribute, $font)  ; dat font va size chu



GUISetState()    ;hien thi giao dien
while 1    ; vong lap xu ly thong diep
      $msg = GUIGetMsg()  ; nhan thong diep
        Switch $msg    ; xet thong diep
            Case $btnGoogle               
                $DNS1 = "8.8.8.8"
                $DNS2 = "8.8.4.4"               
                RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
                RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
            Case $btnDefault
                $DNS1 = "127.0.0.1"
                $DNS2 = "127.0.0.1"   
                RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
                RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")               
            Case $btnComodoDNS
                $DNS1 = "156.154.70.22"
                $DNS2 = "156.154.71.22"               
                RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
                RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
            Case $btnAdvantage
                $DNS1 = "156.154.70.1"
                $DNS2 = "156.154.71.1"               
                RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
                RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
            Case $btnOpenDNS
                $DNS1 = "208.67.222.222"
                $DNS2 = "208.67.220.220"               
                RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
                RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
            Case $btnUltraDNS
                $DNS1 = "204.69.234.1"
                $DNS2 = "204.74.101.1"               
                RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
                RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
            Case $btnlevel3
                $DNS1 = "4.2.2.3"
                $DNS2 = "4.2.2.4"               
                RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
                RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
            Case $btnOpenNIC
                $DNS1 = "58.6.115.42"
                $DNS2 = "58.6.115.43"               
                RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
                RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
            Case $btnDNS8
                $DNS1 = "198.77.116.225"
                $DNS2 = "198.77.116.227"               
                RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
                RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
            Case $btnDNS9
                $DNS1 = "209.244.0.3"
                $DNS2 = "209.244.0.4"               
                RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
                RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
            Case $btnDNS10
                $DNS1 = "141.211.125.17"
                $DNS2 = "141.211.144.17"               
                RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
                RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
            Case $btnDNS11
                $DNS1 = "129.250.35.250"
                $DNS2 = "129.250.35.251"               
                RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
                RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
            Case $btnDNS12
                $DNS1 = "198.77.116.221"
                $DNS2 = "198.77.116.223"               
                RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
                RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
            Case $btnDNS13
                $DNS1 = "66.244.95.20"
                $DNS2 = "66.244.95.22"               
                RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
                RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
            Case $btnDNS14
                $DNS1 = "199.45.32.37"
                $DNS2 = "199.45.32.38"               
                RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
                RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
            Case $btnDNS15
                $DNS1 = "151.202.0.84"
                $DNS2 = "151.202.0.85"               
                RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
                RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")       
            Case $btnDNS16
                $DNS1 = "205.171.2.65"
                $DNS2 = "205.171.3.65"               
                RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
                RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")                   
            Case $GUI_EVENT_CLOSE  ; xu ly su kien dong cua so
                ExitLoop          ; thoat khoi vong lap           
        EndSwitch
WEnd   
Admin
Admin
Admin

Tổng số bài gửi : 63
Join date : 16/08/2011

https://autoitviet.forumvi.com

Về Đầu Trang Go down

Về Đầu Trang


 
Permissions in this forum:
Bạn không có quyền trả lời bài viết