mirror of
https://github.com/netchx/netch.git
synced 2026-03-14 17:43:18 +08:00
:sparkles:启动时显示详细信息
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Netch.Forms;
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
namespace Netch.Controllers
|
||||
@@ -9,6 +10,7 @@ namespace Netch.Controllers
|
||||
|
||||
public bool Start()
|
||||
{
|
||||
MainForm.Instance.StatusText($"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("Starting LocalDns service")}");
|
||||
try
|
||||
{
|
||||
_ = Server.Listen(new IPEndPoint(IPAddress.IPv6Any, 53));
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace Netch.Controllers
|
||||
/// <returns></returns>
|
||||
public (bool, string, string, string) Start()
|
||||
{
|
||||
MainForm.Instance.StatusText($"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("Starting NatTester")}");
|
||||
try
|
||||
{
|
||||
if (!File.Exists("bin\\NTT.exe"))
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Netch.Forms;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
@@ -25,6 +26,7 @@ namespace Netch.Controllers
|
||||
/// <returns>是否启动成功</returns>
|
||||
public bool Start(Models.Server server, Models.Mode mode)
|
||||
{
|
||||
MainForm.Instance.StatusText($"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("Starting Shadowsocks")}");
|
||||
if (!File.Exists("bin\\Shadowsocks.exe"))
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Netch.Forms;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
@@ -25,6 +26,7 @@ namespace Netch.Controllers
|
||||
/// <returns>是否启动成功</returns>
|
||||
public bool Start(Models.Server server, Models.Mode mode)
|
||||
{
|
||||
MainForm.Instance.StatusText($"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("Starting Shadowsocks")}");
|
||||
if (!File.Exists("bin\\ShadowsocksR.exe"))
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.IO;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
using Netch.Forms;
|
||||
using Netch.Utils;
|
||||
|
||||
namespace Netch.Controllers
|
||||
@@ -63,6 +63,7 @@ namespace Netch.Controllers
|
||||
/// </summary>
|
||||
public bool SetupBypass()
|
||||
{
|
||||
MainForm.Instance.StatusText($"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("SetupBypass")}");
|
||||
// 让服务器 IP 走直连
|
||||
foreach (var address in ServerAddresses)
|
||||
{
|
||||
@@ -242,6 +243,7 @@ namespace Netch.Controllers
|
||||
/// <returns>是否成功</returns>
|
||||
public bool Start(Models.Server server, Models.Mode mode)
|
||||
{
|
||||
MainForm.Instance.StatusText($"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("Starting Tap")}");
|
||||
foreach (var proc in Process.GetProcessesByName("tun2socks"))
|
||||
{
|
||||
try
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Netch.Forms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
@@ -26,6 +27,7 @@ namespace Netch.Controllers
|
||||
/// <returns>是否启动成功</returns>
|
||||
public bool Start(Models.Server server, Models.Mode mode)
|
||||
{
|
||||
MainForm.Instance.StatusText($"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("Starting V2ray")}");
|
||||
if (!File.Exists("bin\\v2ray.exe") || !File.Exists("bin\\v2ctl.exe"))
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -41,6 +41,11 @@ namespace Netch.Forms
|
||||
|
||||
public List<Button> ProfileButtons = new List<Button>();
|
||||
|
||||
/// <summary>
|
||||
/// 主窗体的静态实例
|
||||
/// </summary>
|
||||
public static MainForm Instance = null;
|
||||
|
||||
public MainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -48,6 +53,7 @@ namespace Netch.Forms
|
||||
|
||||
CheckForIllegalCrossThreadCalls = false;
|
||||
// MenuStrip.Renderer = new Override.ToolStripProfessionalRender();
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
private void CheckUpdate()
|
||||
@@ -1214,5 +1220,8 @@ namespace Netch.Forms
|
||||
MessageBox.Show(Utils.i18N.Translate("Please select a server first"), Utils.i18N.Translate("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
public void StatusText(string text) {
|
||||
StatusLabel.Text = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,13 @@
|
||||
"Started": "已启动",
|
||||
"Stopping": "正在停止中",
|
||||
"Stopped": "已停止",
|
||||
"Starting Shadowsocks": "正在启动Shadowsocks",
|
||||
"Starting ShadowsocksR": "正在启动ShadowsocksR",
|
||||
"Starting V2ray": "正在启动V2ray",
|
||||
"Starting Tap": "正在启动Tap",
|
||||
"Starting NatTester": "正在启动Nat测试",
|
||||
"Starting LocalDns service": "正在启动本地DNS服务",
|
||||
"SetupBypass": "设置绕行规则",
|
||||
|
||||
"Server": "服务器",
|
||||
"Import Servers From Clipboard": "从剪贴板导入服务器",
|
||||
|
||||
Reference in New Issue
Block a user