Skip to content

Commit

Permalink
更新NetchCore.dll, 移除安装运行库提示
Browse files Browse the repository at this point in the history
  • Loading branch information
chsbuffer committed Aug 9, 2020
1 parent e5e7892 commit 26cde4a
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 38 deletions.
13 changes: 10 additions & 3 deletions Netch/Controllers/MainController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public async Task<bool> Start(Server server, Mode mode)
}
catch (Exception e)
{
Logging.Error("加密代理启动失败未处理异常: " + e);
Logging.Error("加密代理启动失败,未处理异常: " + e);
result = false;
}
}
Expand Down Expand Up @@ -180,7 +180,7 @@ public async Task<bool> Start(Server server, Mode mode)
if (e is DllNotFoundException || e is FileNotFoundException)
MessageBoxX.Show(e.Message + "\n\n" + i18N.Translate("Missing File or runtime components"), owner: Global.MainForm);
else
Logging.Error("模式启动失败未处理异常" + e);
Logging.Error("模式启动失败,未处理异常: " + e);
result = false;
}
}
Expand Down Expand Up @@ -222,7 +222,14 @@ public async Task<bool> Start(Server server, Mode mode)
if (!result)
{
Logging.Error("主控制器启动失败");
await Stop();
try
{
await Stop();
}
catch
{
// ignored
}
}

return result;
Expand Down
14 changes: 1 addition & 13 deletions Netch/Forms/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions Netch/Forms/MainForm.MenuStrip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,6 @@ private void exitToolStripMenuItem_Click(object sender, EventArgs e)
Exit(true);
}

private void RelyToolStripMenuItem_Click(object sender, EventArgs e)
{
Utils.Utils.Open("https://mega.nz/file/9OQ1EazJ#0pjJ3xt57AVLr29vYEEv15GSACtXVQOGlEOPpi_2Ico");
}

private void VersionLabel_Click(object sender, EventArgs e)
{
Utils.Utils.Open($"https://github.com/{UpdateChecker.Owner}/{UpdateChecker.Repo}/releases");
Expand Down
1 change: 0 additions & 1 deletion Netch/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ private void InitText()
AboutToolStripButton.Text = i18N.Translate("About");
// VersionLabel.Text = i18N.Translate("xxx");
exitToolStripMenuItem.Text = i18N.Translate("Exit");
RelyToolStripMenuItem.Text = i18N.Translate("Unable to start? Click me to download");
ConfigurationGroupBox.Text = i18N.Translate("Configuration");
ProfileLabel.Text = i18N.Translate("Profile");
ModeLabel.Text = i18N.Translate("Mode");
Expand Down
14 changes: 1 addition & 13 deletions Netch/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,11 @@ public static class NativeMethods
[DllImport("bin\\NetchCore", CallingConvention = CallingConvention.Cdecl, EntryPoint = "CreateRoute")]
public static extern bool CreateRoute(string address, int cidr, string gateway, int index, int metric = 0);

/// <summary>
/// 修改路由规则
/// </summary>
/// <param name="address">目标地址</param>
/// <param name="cidr">CIDR</param>
/// <param name="gateway">网关地址</param>
/// <param name="index">适配器索引</param>
/// <param name="metric">跃点数</param>
/// <returns>是否成功</returns>
[DllImport("bin\\NetchCore", CallingConvention = CallingConvention.Cdecl, EntryPoint = "ChangeRoute")]
public static extern bool ChangeRoute(string address, int cidr, string gateway, int index, int metric = 0);

/// <summary>
/// 删除路由规则
/// </summary>
/// <param name="address">目标地址</param>
/// <param name="netmask">掩码地址</param>
/// <param name="cidr">掩码地址</param>
/// <param name="gateway">网关地址</param>
/// <param name="index">适配器索引</param>
/// <param name="metric">跃点数</param>
Expand Down
3 changes: 1 addition & 2 deletions Netch/Utils/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,11 @@ public static void Load()
{
// 弹出提示
i18N.Load("System");
MessageBoxX.Show(i18N.Translate("If this is your first time using this software,\n please check https://netch.org to install supports first,\n or the program may report errors."));
// MessageBoxX.Show(i18N.Translate("If this is your first time using this software,\n please check https://netch.org to install supports first,\n or the program may report errors."));

// 创建 data 文件夹并保存默认设置
Save();
}

}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion binaries

0 comments on commit 26cde4a

Please sign in to comment.