mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-06-28 11:24:46 +08:00
feat: 新增 Hosts 写入功能,通过预设的干净 DNS 获取ip 并 写入 hosts 文件
This commit is contained in:
@ -257,4 +257,10 @@ foreach ($adapter in $adapterMemory) {
|
||||
await Process.run(
|
||||
SystemHelper.powershellPath, ["explorer.exe", "/select,\"$path\""]);
|
||||
}
|
||||
|
||||
static String getHostsFilePath() {
|
||||
final envVars = Platform.environment;
|
||||
final systemRoot = envVars["SYSTEMROOT"];
|
||||
return "$systemRoot\\System32\\drivers\\etc\\hosts";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user