Skip to content

Commit

Permalink
修复启动异常抛出bug
Browse files Browse the repository at this point in the history
更换获取isp的api
  • Loading branch information
Guailoudou committed Jan 6, 2025
1 parent 6e738ab commit 565d98c
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 17 deletions.
16 changes: 9 additions & 7 deletions WpfApp1/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -531,14 +531,16 @@ private void Strapp()
return;
}
OpenDate = DateTime.Now;
if (process != null && !process.HasExited)
if (process != null)
{
process.CancelOutputRead();
process.CancelErrorRead();
process.Kill();
Stop();
//if (udps != null) foreach (UdpClientKeepAlive app in udps) app.StopSendingKeepAlive();
if (tcps != null) foreach (TcpClientWithKeepAlive app in tcps) app.StopSendingKeepAlive();
if (!process.HasExited)
{
process.CancelOutputRead();
process.CancelErrorRead();
process.Kill();
Stop();
if (tcps != null) foreach (TcpClientWithKeepAlive app in tcps) app.StopSendingKeepAlive();
}
}
else
{
Expand Down
16 changes: 11 additions & 5 deletions WpfApp1/OPL WpfApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,22 @@
<PublishUrl>D:\web\gitfileurl\urlfile\file\pack\</PublishUrl>
<Install>true</Install>
<InstallFrom>Web</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateEnabled>true</UpdateEnabled>
<UpdateMode>Background</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<InstallUrl>https://file.gldhn.top/file/pack/</InstallUrl>
<UpdateUrl>https://file.gldhn.top/file/pack/</UpdateUrl>
<PublisherName>gld</PublisherName>
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
<AutorunEnabled>true</AutorunEnabled>
<ApplicationRevision>5</ApplicationRevision>
<ApplicationRevision>8</ApplicationRevision>
<ApplicationVersion>1.0.1.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
Expand Down Expand Up @@ -69,20 +72,23 @@
<TargetZone>LocalIntranet</TargetZone>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>false</GenerateManifests>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup>
<SignManifests>false</SignManifests>
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>707B96B6EBF813FB60EF7CDE1145D66055D796A9</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>OPL WpfApp_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<ManifestTimestampUrl>http://timestamp.digicert.com</ManifestTimestampUrl>
</PropertyGroup>
<ItemGroup>
<Reference Include="Costura, Version=5.7.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.5.7.0\lib\netstandard1.0\Costura.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion WpfApp1/OPL WpfApp.csproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PublishUrlHistory>D:\web\gitfileurl\urlfile\file\pack\</PublishUrlHistory>
<InstallUrlHistory>https://file.gldhn.top/file/pack/|https://file.gldhn.top/</InstallUrlHistory>
<SupportUrlHistory />
<UpdateUrlHistory />
<UpdateUrlHistory>https://file.gldhn.top/file/pack/</UpdateUrlHistory>
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>zh-CN</FallbackCulture>
Expand Down
2 changes: 1 addition & 1 deletion WpfApp1/Properties/app.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</requestedPrivileges>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" />
<PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" Unrestricted="true" />
</applicationRequestMinimum>
</security>
</trustInfo>
Expand Down
7 changes: 4 additions & 3 deletions WpfApp1/cs/net.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ public async Task Getthank(TextBox text)

public async Task Getisp(string ip)
{
string url = "https://uapis.cn/api/ipinfo?ip=" + ip;
string url = "https://cn.apihz.cn/api/ip/chaapi.php?id=10001875&key=dddd7577f7f5ea74a29854ab11bbea0a&ip=" + ip;
//string url = "https://uapis.cn/api/ipinfo?ip=" + ip;
string isp="";
HttpClient httpClient = new HttpClient();
set set = new set();
Expand All @@ -223,7 +224,7 @@ public async Task Getisp(string ip)
if(ipinfo.code == 200)
{
isp = ipinfo.isp;
Logger.Log($"[提示]经检测你的网络运营商为:{isp} --数据由Uapi提供");
Logger.Log($"[提示]经检测你的网络运营商为:{isp} --数据由apihz提供");
if (isp != "电信" && isp != "联通" && isp != "移动")
{
if(set.settings.ispwarning)
Expand All @@ -232,7 +233,7 @@ public async Task Getisp(string ip)
}
else
{
Logger.Log($"[错误]获取{ip}的运营商信息失败");
Logger.Log($"[错误]获取{ip}的运营商信息失败 {ipinfo.code}");
}


Expand Down
Binary file removed WpfApp1/openp2p.exe
Binary file not shown.

0 comments on commit 565d98c

Please sign in to comment.