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
.vscode/*
/ProxySU_Core/Data/Record.json
/ProxySuper.WPF/bin

View File

@ -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}");

View File

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