1
0
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:
autumn 2022-04-22 09:52:43 +08:00
parent 2567635002
commit 10c8c0f74e
3 changed files with 7 additions and 2 deletions

1
.gitignore vendored
View File

@ -199,3 +199,4 @@ FakesAssemblies/
# vs code # vs code
.vscode/* .vscode/*
/ProxySU_Core/Data/Record.json /ProxySU_Core/Data/Record.json
/ProxySuper.WPF/bin

View File

@ -412,7 +412,7 @@ namespace ProxySuper.Core.Services
string cmd; string cmd;
Progress.Desc = ("检测IPv4"); 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'); IPv4 = cmd.TrimEnd('\r', '\n');
Progress.Desc = ($"IPv4地址为{IPv4}"); Progress.Desc = ($"IPv4地址为{IPv4}");
@ -423,7 +423,7 @@ namespace ProxySuper.Core.Services
else else
{ {
Progress.Desc = ("检测IPv6"); 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'); IPv6 = cmd.TrimEnd('\r', '\n');
Progress.Desc = ($"IPv6地址为{IPv6}"); Progress.Desc = ($"IPv6地址为{IPv6}");

View File

@ -53,6 +53,10 @@ namespace ProxySuper.Core.ViewModels
{ {
ContractResolver = new CamelCasePropertyNamesContractResolver() ContractResolver = new CamelCasePropertyNamesContractResolver()
}); });
if (!Directory.Exists("Data"))
{
Directory.CreateDirectory("Data");
}
File.WriteAllText("Data/Record.json", json); File.WriteAllText("Data/Record.json", json);
} }