mirror of
https://github.com/proxysu/ProxySU.git
synced 2024-11-23 21:56:08 +03:00
fix ip.sb
This commit is contained in:
parent
2567635002
commit
10c8c0f74e
1
.gitignore
vendored
1
.gitignore
vendored
@ -199,3 +199,4 @@ FakesAssemblies/
|
||||
# vs code
|
||||
.vscode/*
|
||||
/ProxySU_Core/Data/Record.json
|
||||
/ProxySuper.WPF/bin
|
||||
|
@ -412,7 +412,7 @@ namespace ProxySuper.Core.Services
|
||||
string cmd;
|
||||
|
||||
Progress.Desc = ("检测IPv4");
|
||||
cmd = RunCmd(@"curl -s https://api.ip.sb/ip --ipv4 --max-time 8");
|
||||
cmd = RunCmd(@"curl -4 ip.sb");
|
||||
IPv4 = cmd.TrimEnd('\r', '\n');
|
||||
|
||||
Progress.Desc = ($"IPv4地址为{IPv4}");
|
||||
@ -423,7 +423,7 @@ namespace ProxySuper.Core.Services
|
||||
else
|
||||
{
|
||||
Progress.Desc = ("检测IPv6");
|
||||
cmd = RunCmd(@"curl -s https://api.ip.sb/ip --ipv6 --max-time 8");
|
||||
cmd = RunCmd(@"curl -6 ip.sb");
|
||||
IPv6 = cmd.TrimEnd('\r', '\n');
|
||||
Progress.Desc = ($"IPv6地址为{IPv6}");
|
||||
|
||||
|
@ -53,6 +53,10 @@ namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver()
|
||||
});
|
||||
if (!Directory.Exists("Data"))
|
||||
{
|
||||
Directory.CreateDirectory("Data");
|
||||
}
|
||||
File.WriteAllText("Data/Record.json", json);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user