自动更新HOSTS,有什么用,可以翻x。可惜谷歌连ip都被我朝屏蔽了。别的大点的网站可以。
直接上代码
//RUNAS//
import fsys;
import inet.http;
import console;
var http = inet.http();
var hosts = http.get("https://raw.githubusercontent.com/racaljk/hosts/master/hosts");
if(hosts){
var hostsPath = fsys.getSpecial(0x25 /*_CSIDL_SYSTEM*/,"\drivers\etc\hosts");
string.save(hostsPath,hosts)
//刷新DNS
var dnsapi = raw.loadDll("dnsapi.dll")
dnsapi.DnsFlushResolverCache();
console.pause(,"已更新hosts");
}
else {
console.pause(,"更新失败hosts");
}