mirror of
https://github.com/netchx/netch.git
synced 2026-05-11 23:45:06 +08:00
Compare commits
25 Commits
2020/3/10
...
1.4.1-Beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d616380deb | ||
|
|
c6817e39b2 | ||
|
|
b08cd53cee | ||
|
|
bf8dd98013 | ||
|
|
89c3ffaaf6 | ||
|
|
1dcb96819b | ||
|
|
e33cd6d2d2 | ||
|
|
7998be0c74 | ||
|
|
238892ea2c | ||
|
|
08332667ad | ||
|
|
bc6bc52b9a | ||
|
|
2977afe00e | ||
|
|
f36ff457b4 | ||
|
|
d1d58cc39c | ||
|
|
bd0b3a6f2e | ||
|
|
35eae6094e | ||
|
|
725fdc2e9a | ||
|
|
bd05f875f2 | ||
|
|
ea3fb188e4 | ||
|
|
ee3ac561b5 | ||
|
|
4fb090d7a4 | ||
|
|
9302900b5d | ||
|
|
6dd50f1510 | ||
|
|
91f73b936d | ||
|
|
9ddcc3ae3c |
71
.github/workflows/dotnetcore.yml
vendored
Normal file
71
.github/workflows/dotnetcore.yml
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
name: GitHub Actions & Netch CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Get tag name
|
||||
uses: olegtarasov/get-tag@v1
|
||||
|
||||
- name: submodules-init
|
||||
uses: snickerbockers/submodules-init@v4
|
||||
|
||||
- uses: nuget/setup-nuget@v1
|
||||
- run: nuget restore Netch.sln
|
||||
|
||||
- name: Setup MSBuild.exe
|
||||
uses: microsoft/setup-msbuild@v1.0.0
|
||||
|
||||
- name: Build .NET 4.8 Netch
|
||||
shell: pwsh
|
||||
run: |
|
||||
.\build.ps1
|
||||
New-Item -ItemType Directory -Path C:\builtfiles -Force > $null
|
||||
Compress-Archive -Path Netch\bin\x64\Release\win-x64\* -DestinationPath C:\builtfiles\Netch.x64-${{ env.GITHUB_TAG_NAME }}.zip
|
||||
echo "::set-env name=Netch64_SHA256::$(.\getSHA256.ps1 C:\builtfiles\Netch.x64-${{ env.GITHUB_TAG_NAME }}.zip)"
|
||||
Compress-Archive -Path Netch\bin\x86\Release\win-x86\* -DestinationPath C:\builtfiles\Netch.x86-${{ env.GITHUB_TAG_NAME }}.zip
|
||||
echo "::set-env name=Netch86_SHA256::$(.\getSHA256.ps1 C:\builtfiles\Netch.x86-${{ env.GITHUB_TAG_NAME }}.zip)"
|
||||
|
||||
- name: Upload Netch.x64
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Netch.x64
|
||||
path: Netch\bin\x64\Release\win-x64
|
||||
|
||||
- name: Upload Netch.x86
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Netch.x86
|
||||
path: Netch\bin\x86\Release\win-x86
|
||||
|
||||
# Create a new release: create a tag, then 'git push origin <tagname>', wait for it to build
|
||||
- name: Create a new GitHub release if a new tag is pushed
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
name: ${{ env.GITHUB_TAG_NAME }}
|
||||
prerelease: true
|
||||
draft: false
|
||||
files: |
|
||||
C:\builtfiles\Netch.x64-${{ env.GITHUB_TAG_NAME }}.zip
|
||||
C:\builtfiles\Netch.x86-${{ env.GITHUB_TAG_NAME }}.zip
|
||||
body: |
|
||||
|
||||
[](https://t.me/Netch) [](https://t.me/Netch_Discuss_Group)
|
||||
|
||||
## 更新日志:
|
||||
* 这是 GitHub Action 自动化部署,更新日志应该很快会手动更新:D
|
||||
|
||||
## 文件校验
|
||||
| 文件名 | SHA256 |
|
||||
| :- | :- |
|
||||
| <sub>Netch.x64-${{ env.GITHUB_TAG_NAME }}.zip</sub> | <sub>${{ env.Netch64_SHA256 }}</sub> |
|
||||
| <sub>Netch.x86-${{ env.GITHUB_TAG_NAME }}.zip</sub> | <sub>${{ env.Netch86_SHA256 }}</sub> |
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
@@ -1,12 +1,15 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Netch.Controllers
|
||||
{
|
||||
public class MainController
|
||||
{
|
||||
[DllImport("dnsapi", EntryPoint = "DnsFlushResolverCache")]
|
||||
public static extern UInt32 FlushDNSResolverCache();
|
||||
public static Process GetProcess()
|
||||
{
|
||||
var process = new Process();
|
||||
@@ -65,6 +68,8 @@ namespace Netch.Controllers
|
||||
/// <returns>是否启动成功</returns>
|
||||
public bool Start(Models.Server server, Models.Mode mode)
|
||||
{
|
||||
FlushDNSResolverCache();
|
||||
|
||||
var result = false;
|
||||
switch (server.Type)
|
||||
{
|
||||
|
||||
@@ -49,9 +49,26 @@ namespace Netch.Controllers
|
||||
// 生成驱动文件路径
|
||||
var driver = string.Format("{0}\\drivers\\netfilter2.sys", Environment.SystemDirectory);
|
||||
|
||||
// 检查驱动是否存在
|
||||
if (!File.Exists(driver))
|
||||
if (File.Exists(driver))
|
||||
{
|
||||
//为了防止小白一直问如何卸载老驱动核心,每次启动时卸载删除一次驱动,保证系统使用最新驱动核心(简单粗暴 但有效:D。增加启动成功率,驱动在被其他加速器占用的情况下可能会导致启动失败
|
||||
try
|
||||
{
|
||||
var service = new ServiceController("netfilter2");
|
||||
if (service.Status == ServiceControllerStatus.Running)
|
||||
{
|
||||
service.Stop();
|
||||
service.WaitForStatus(ServiceControllerStatus.Stopped);
|
||||
}
|
||||
nfapinet.NFAPI.nf_unRegisterDriver("netfilter2");
|
||||
|
||||
File.Delete(driver);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// 跳过
|
||||
}
|
||||
|
||||
// 生成系统版本
|
||||
var version = $"{Environment.OSVersion.Version.Major.ToString()}.{Environment.OSVersion.Version.Minor.ToString()}";
|
||||
|
||||
@@ -94,6 +111,10 @@ namespace Netch.Controllers
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 检查驱动是否存在
|
||||
/*if (!File.Exists(driver))
|
||||
{
|
||||
}*/
|
||||
|
||||
try
|
||||
{
|
||||
@@ -116,9 +137,8 @@ namespace Netch.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
var processes = "";
|
||||
var processes = "NTT.exe,";
|
||||
|
||||
mode.Rule.Add("NTT.exe");
|
||||
foreach (var proc in mode.Rule)
|
||||
{
|
||||
processes += proc;
|
||||
@@ -152,7 +172,7 @@ namespace Netch.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
Instance.StartInfo.Arguments = fallback + $" -t {Global.Settings.RedirectorTCPPort}";
|
||||
Instance.StartInfo.Arguments = fallback;
|
||||
Instance.OutputDataReceived += OnOutputDataReceived;
|
||||
Instance.ErrorDataReceived += OnOutputDataReceived;
|
||||
State = Models.State.Starting;
|
||||
@@ -160,7 +180,6 @@ namespace Netch.Controllers
|
||||
Instance.BeginOutputReadLine();
|
||||
Instance.BeginErrorReadLine();
|
||||
|
||||
var IsFallback = false;
|
||||
for (var i = 0; i < 1000; i++)
|
||||
{
|
||||
Thread.Sleep(10);
|
||||
@@ -169,33 +188,6 @@ namespace Netch.Controllers
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (State == Models.State.Stopped)
|
||||
{
|
||||
if (!IsFallback)
|
||||
{
|
||||
IsFallback = true;
|
||||
Stop();
|
||||
Utils.Logging.Info($"尝试去除 \"-t {Global.Settings.RedirectorTCPPort}\" 参数后启动 \"bin\\Redirector.exe\"");
|
||||
Instance.StartInfo.Arguments = fallback;
|
||||
Utils.Logging.Info($"当前 \"bin\\Redirector.exe\" 启动参数为 \"{Instance.StartInfo.Arguments}\"");
|
||||
Global.Settings.RedirectorTCPPort = 2800;
|
||||
Instance.CancelOutputRead();
|
||||
Instance.CancelErrorRead();
|
||||
Instance.OutputDataReceived += OnOutputDataReceived;
|
||||
Instance.ErrorDataReceived += OnOutputDataReceived;
|
||||
State = Models.State.Starting;
|
||||
Instance.Start();
|
||||
Instance.BeginOutputReadLine();
|
||||
Instance.BeginErrorReadLine();
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.Logging.Info("NF 进程启动失败");
|
||||
Stop();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Utils.Logging.Info("NF 进程启动超时");
|
||||
@@ -234,7 +226,7 @@ namespace Netch.Controllers
|
||||
{
|
||||
State = Models.State.Stopped;
|
||||
}
|
||||
else if (e.Data.Contains("Started"))
|
||||
else if (e.Data.Contains("Started") || e.Data.Contains("Redirect to"))
|
||||
{
|
||||
State = Models.State.Started;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
@@ -37,6 +38,9 @@ namespace Netch.Controllers
|
||||
/// </summary>
|
||||
public DNSController pDNSController = new DNSController();
|
||||
|
||||
// ByPassLan IP
|
||||
List<string> BypassLanIPs = new List<string>() { "10.0.0.0/8", "172.16.0.0/16", "192.168.0.0/24" };
|
||||
|
||||
/// <summary>
|
||||
/// 配置 TUNTAP 适配器
|
||||
/// </summary>
|
||||
@@ -101,6 +105,17 @@ namespace Netch.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var ip in BypassLanIPs)
|
||||
{
|
||||
var info = ip.Split('/');
|
||||
var address = IPAddress.Parse(info[0]);
|
||||
|
||||
if (!IPAddress.IsLoopback(address))
|
||||
{
|
||||
NativeMethods.CreateRoute(address.ToString(), int.Parse(info[1]), Global.Adapter.Gateway.ToString(), Global.Adapter.Index);
|
||||
}
|
||||
}
|
||||
|
||||
if (SavedMode.Type == 2) // 处理仅规则内走直连
|
||||
{
|
||||
// 将 TUN/TAP 网卡权重放到最高
|
||||
@@ -157,6 +172,54 @@ namespace Netch.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
//处理NAT类型检测,由于协议的原因,无法仅通过域名确定需要代理的IP,自己记录解析了返回的IP,仅支持默认检测服务器
|
||||
if (Global.Settings.STUN_Server == "stun.stunprotocol.org")
|
||||
{
|
||||
try
|
||||
{
|
||||
var nttAddress = Dns.GetHostAddresses(Global.Settings.STUN_Server)[0];
|
||||
if (int.TryParse("32", out var prefix))
|
||||
{
|
||||
NativeMethods.CreateRoute(nttAddress.ToString(), prefix, Global.Settings.TUNTAP.Gateway, Global.TUNTAP.Index);
|
||||
}
|
||||
var nttrAddress = Dns.GetHostAddresses("stunresponse.coldthunder11.com")[0];
|
||||
if (int.TryParse("32", out var prefixr))
|
||||
{
|
||||
NativeMethods.CreateRoute(nttrAddress.ToString(), prefixr, Global.Settings.TUNTAP.Gateway, Global.TUNTAP.Index);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Logging.Info("NAT类型测试域名解析失败,将不会被添加到代理列表。");
|
||||
}
|
||||
}
|
||||
//处理DNS代理
|
||||
if (Global.Settings.TUNTAP.ProxyDNS)
|
||||
{
|
||||
if (Global.Settings.TUNTAP.UseCustomDNS)
|
||||
{
|
||||
string dns = "";
|
||||
foreach (var value in Global.Settings.TUNTAP.DNS)
|
||||
{
|
||||
dns += value;
|
||||
dns += ',';
|
||||
}
|
||||
|
||||
dns = dns.Trim();
|
||||
dns = dns.Substring(0, dns.Length - 1);
|
||||
if (int.TryParse("32", out var prefix))
|
||||
{
|
||||
NativeMethods.CreateRoute(dns, prefix, Global.Settings.TUNTAP.Gateway, Global.TUNTAP.Index);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (int.TryParse("32", out var prefix))
|
||||
{
|
||||
NativeMethods.CreateRoute("1.1.1.1", prefix, Global.Settings.TUNTAP.Gateway, Global.TUNTAP.Index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -198,6 +261,49 @@ namespace Netch.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Global.Settings.STUN_Server == "stun.stunprotocol.org")
|
||||
{
|
||||
try
|
||||
{
|
||||
var nttAddress = Dns.GetHostAddresses(Global.Settings.STUN_Server)[0];
|
||||
if (int.TryParse("32", out var prefix))
|
||||
{
|
||||
NativeMethods.DeleteRoute(nttAddress.ToString(), prefix, Global.Settings.TUNTAP.Gateway, Global.TUNTAP.Index);
|
||||
}
|
||||
var nttrAddress = Dns.GetHostAddresses("stunresponse.coldthunder11.com")[0];
|
||||
if (int.TryParse("32", out var prefixr))
|
||||
{
|
||||
NativeMethods.DeleteRoute(nttrAddress.ToString(), prefixr, Global.Settings.TUNTAP.Gateway, Global.TUNTAP.Index);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
if (Global.Settings.TUNTAP.ProxyDNS)
|
||||
{
|
||||
if (Global.Settings.TUNTAP.UseCustomDNS)
|
||||
{
|
||||
string dns = "";
|
||||
foreach (var value in Global.Settings.TUNTAP.DNS)
|
||||
{
|
||||
dns += value;
|
||||
dns += ',';
|
||||
}
|
||||
|
||||
dns = dns.Trim();
|
||||
dns = dns.Substring(0, dns.Length - 1);
|
||||
if (int.TryParse("32", out var prefix))
|
||||
{
|
||||
NativeMethods.DeleteRoute(dns, prefix, Global.Settings.TUNTAP.Gateway, Global.TUNTAP.Index);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (int.TryParse("32", out var prefix))
|
||||
{
|
||||
NativeMethods.DeleteRoute("1.1.1.1", prefix, Global.Settings.TUNTAP.Gateway, Global.TUNTAP.Index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var ip in Global.Settings.BypassIPs)
|
||||
@@ -210,6 +316,16 @@ namespace Netch.Controllers
|
||||
NativeMethods.DeleteRoute(address.ToString(), int.Parse(info[1]), Global.Adapter.Gateway.ToString(), Global.Adapter.Index);
|
||||
}
|
||||
}
|
||||
foreach (var ip in BypassLanIPs)
|
||||
{
|
||||
var info = ip.Split('/');
|
||||
var address = IPAddress.Parse(info[0]);
|
||||
|
||||
if (!IPAddress.IsLoopback(address))
|
||||
{
|
||||
NativeMethods.DeleteRoute(address.ToString(), int.Parse(info[1]), Global.Adapter.Gateway.ToString(), Global.Adapter.Index);
|
||||
}
|
||||
}
|
||||
|
||||
if (SavedMode.BypassChina)
|
||||
{
|
||||
@@ -300,7 +416,7 @@ namespace Netch.Controllers
|
||||
else
|
||||
{
|
||||
pDNSController.Start();
|
||||
dns = "127.0.0.1,127.0.0.1";
|
||||
dns = "127.0.0.1";
|
||||
//dns = "1.1.1.1,1.0.0.1";
|
||||
}
|
||||
|
||||
@@ -311,7 +427,7 @@ namespace Netch.Controllers
|
||||
else
|
||||
{
|
||||
Instance.StartInfo.Arguments = string.Format("-proxyServer 127.0.0.1:{0} -tunAddr {1} -tunMask {2} -tunGw {3} -tunDns {4} -tunName \"{5}\"", Global.Settings.Socks5LocalPort, Global.Settings.TUNTAP.Address, Global.Settings.TUNTAP.Netmask, Global.Settings.TUNTAP.Gateway, dns, adapterName);
|
||||
}
|
||||
}
|
||||
|
||||
Instance.StartInfo.CreateNoWindow = true;
|
||||
Instance.StartInfo.RedirectStandardError = true;
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Netch.Controllers
|
||||
|
||||
public const string Name = @"Netch";
|
||||
public const string Copyright = @"Copyright © 2019 - 2020";
|
||||
public const string Version = @"1.3.9";
|
||||
public const string Version = @"1.4.0";
|
||||
|
||||
public async void Check(bool notifyNoFound, bool isPreRelease)
|
||||
{
|
||||
|
||||
@@ -238,60 +238,66 @@ namespace Netch.Forms
|
||||
|
||||
private void ComboBox_DrawItem(object sender, DrawItemEventArgs e)
|
||||
{
|
||||
var cbx = sender as ComboBox;
|
||||
|
||||
// 绘制背景颜色
|
||||
e.Graphics.FillRectangle(new SolidBrush(Color.White), e.Bounds);
|
||||
|
||||
if (e.Index >= 0)
|
||||
try
|
||||
{
|
||||
// 绘制 备注/名称 字符串
|
||||
e.Graphics.DrawString(cbx.Items[e.Index].ToString(), cbx.Font, new SolidBrush(Color.Black), e.Bounds);
|
||||
|
||||
if (cbx.Items[e.Index] is Models.Server)
|
||||
var cbx = sender as ComboBox;
|
||||
|
||||
// 绘制背景颜色
|
||||
e.Graphics.FillRectangle(new SolidBrush(Color.White), e.Bounds);
|
||||
|
||||
if (e.Index >= 0)
|
||||
{
|
||||
var item = cbx.Items[e.Index] as Models.Server;
|
||||
// 绘制 备注/名称 字符串
|
||||
e.Graphics.DrawString(cbx.Items[e.Index].ToString(), cbx.Font, new SolidBrush(Color.Black), e.Bounds);
|
||||
|
||||
// 计算延迟底色
|
||||
SolidBrush brush;
|
||||
if (item.Delay > 200)
|
||||
if (cbx.Items[e.Index] is Models.Server)
|
||||
{
|
||||
// 红色
|
||||
brush = new SolidBrush(Color.Red);
|
||||
var item = cbx.Items[e.Index] as Models.Server;
|
||||
|
||||
// 计算延迟底色
|
||||
SolidBrush brush;
|
||||
if (item.Delay > 200)
|
||||
{
|
||||
// 红色
|
||||
brush = new SolidBrush(Color.Red);
|
||||
}
|
||||
else if (item.Delay > 80)
|
||||
{
|
||||
// 黄色
|
||||
brush = new SolidBrush(Color.Yellow);
|
||||
}
|
||||
else if (item.Delay >= 0)
|
||||
{
|
||||
// 绿色
|
||||
brush = new SolidBrush(Color.FromArgb(50, 255, 56));
|
||||
}
|
||||
else
|
||||
{
|
||||
// 灰色
|
||||
brush = new SolidBrush(Color.Gray);
|
||||
}
|
||||
|
||||
// 绘制延迟底色
|
||||
e.Graphics.FillRectangle(brush, ServerComboBox.Size.Width - 60, e.Bounds.Y, 60, e.Bounds.Height);
|
||||
|
||||
// 绘制延迟字符串
|
||||
e.Graphics.DrawString(item.Delay.ToString(), cbx.Font, new SolidBrush(Color.Black), ServerComboBox.Size.Width - 58, e.Bounds.Y);
|
||||
}
|
||||
else if (item.Delay > 80)
|
||||
else if (cbx.Items[e.Index] is Models.Mode)
|
||||
{
|
||||
// 黄色
|
||||
brush = new SolidBrush(Color.Yellow);
|
||||
var item = cbx.Items[e.Index] as Models.Mode;
|
||||
|
||||
// 绘制延迟底色
|
||||
e.Graphics.FillRectangle(new SolidBrush(Color.Gray), ServerComboBox.Size.Width - 60, e.Bounds.Y, 60, e.Bounds.Height);
|
||||
|
||||
// 绘制延迟字符串
|
||||
e.Graphics.DrawString(item.Rule.Count.ToString(), cbx.Font, new SolidBrush(Color.Black), ServerComboBox.Size.Width - 58, e.Bounds.Y);
|
||||
}
|
||||
else if (item.Delay >= 0)
|
||||
{
|
||||
// 绿色
|
||||
brush = new SolidBrush(Color.FromArgb(50, 255, 56));
|
||||
}
|
||||
else
|
||||
{
|
||||
// 灰色
|
||||
brush = new SolidBrush(Color.Gray);
|
||||
}
|
||||
|
||||
// 绘制延迟底色
|
||||
e.Graphics.FillRectangle(brush, ServerComboBox.Size.Width - 60, e.Bounds.Y, 60, e.Bounds.Height);
|
||||
|
||||
// 绘制延迟字符串
|
||||
e.Graphics.DrawString(item.Delay.ToString(), cbx.Font, new SolidBrush(Color.Black), ServerComboBox.Size.Width - 58, e.Bounds.Y);
|
||||
}
|
||||
else if (cbx.Items[e.Index] is Models.Mode)
|
||||
{
|
||||
var item = cbx.Items[e.Index] as Models.Mode;
|
||||
|
||||
// 绘制延迟底色
|
||||
e.Graphics.FillRectangle(new SolidBrush(Color.Gray), ServerComboBox.Size.Width - 60, e.Bounds.Y, 60, e.Bounds.Height);
|
||||
|
||||
// 绘制延迟字符串
|
||||
e.Graphics.DrawString(item.Rule.Count.ToString(), cbx.Font, new SolidBrush(Color.Black), ServerComboBox.Size.Width - 58, e.Bounds.Y);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{ }
|
||||
}
|
||||
|
||||
private void MainForm_Load(object sender, EventArgs e)
|
||||
@@ -482,6 +488,7 @@ namespace Netch.Forms
|
||||
|
||||
if (Global.Settings.SubscribeLink.Count > 0)
|
||||
{
|
||||
StatusLabel.Text = $"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("Starting update subscription")}";
|
||||
DeletePictureBox.Enabled = false;
|
||||
|
||||
UpdateServersFromSubscribeLinksToolStripMenuItem.Enabled = false;
|
||||
@@ -565,6 +572,7 @@ namespace Netch.Forms
|
||||
NatTypeStatusLabel.Text = "";
|
||||
}
|
||||
Utils.Configuration.Save();
|
||||
StatusLabel.Text = $"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("Subscription updated")}";
|
||||
}).ContinueWith(task =>
|
||||
{
|
||||
BeginInvoke(new Action(() =>
|
||||
@@ -766,6 +774,7 @@ namespace Netch.Forms
|
||||
|
||||
private void ControlButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveConfigs();
|
||||
if (State == Models.State.Waiting || State == Models.State.Stopped)
|
||||
{
|
||||
// 当前 ServerComboBox 中至少有一项
|
||||
@@ -1218,7 +1227,14 @@ namespace Netch.Forms
|
||||
}
|
||||
public void NatTypeStatusText(string text)
|
||||
{
|
||||
NatTypeStatusLabel.Text = "NatType:" + text;
|
||||
if (!string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
NatTypeStatusLabel.Text = "NAT" + Utils.i18N.Translate(": ") + text;
|
||||
}
|
||||
else
|
||||
{
|
||||
NatTypeStatusLabel.Text = "NAT" + Utils.i18N.Translate(": ") + Utils.i18N.Translate("Test failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
261
Netch/Forms/SettingForm.Designer.cs
generated
261
Netch/Forms/SettingForm.Designer.cs
generated
@@ -30,14 +30,13 @@
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingForm));
|
||||
this.PortGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.RedirectorLabel = new System.Windows.Forms.Label();
|
||||
this.RedirectorTextBox = new System.Windows.Forms.TextBox();
|
||||
this.AllowDevicesCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.HTTPPortLabel = new System.Windows.Forms.Label();
|
||||
this.HTTPPortTextBox = new System.Windows.Forms.TextBox();
|
||||
this.Socks5PortLabel = new System.Windows.Forms.Label();
|
||||
this.Socks5PortTextBox = new System.Windows.Forms.TextBox();
|
||||
this.TUNTAPGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.TUNTAPProxyDNSCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.TUNTAPUseCustomDNSCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.TUNTAPDNSLabel = new System.Windows.Forms.Label();
|
||||
this.TUNTAPDNSTextBox = new System.Windows.Forms.TextBox();
|
||||
@@ -50,7 +49,11 @@
|
||||
this.ControlButton = new System.Windows.Forms.Button();
|
||||
this.GlobalBypassIPsButton = new System.Windows.Forms.Button();
|
||||
this.BehaviorGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.STUN_ServerPortTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.RunAtStartup = new System.Windows.Forms.CheckBox();
|
||||
this.STUN_ServerTextBox = new System.Windows.Forms.TextBox();
|
||||
this.MinimizeWhenStartedCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.ProfileCount_Label = new System.Windows.Forms.Label();
|
||||
this.ProfileCount_TextBox = new System.Windows.Forms.TextBox();
|
||||
@@ -58,10 +61,6 @@
|
||||
this.StartWhenOpenedCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.StopWhenExitedCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.ExitWhenClosedCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.STUN_ServerTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.STUN_ServerPortTextBox = new System.Windows.Forms.TextBox();
|
||||
this.PortGroupBox.SuspendLayout();
|
||||
this.TUNTAPGroupBox.SuspendLayout();
|
||||
this.BehaviorGroupBox.SuspendLayout();
|
||||
@@ -69,43 +68,27 @@
|
||||
//
|
||||
// PortGroupBox
|
||||
//
|
||||
this.PortGroupBox.Controls.Add(this.RedirectorLabel);
|
||||
this.PortGroupBox.Controls.Add(this.RedirectorTextBox);
|
||||
this.PortGroupBox.Controls.Add(this.AllowDevicesCheckBox);
|
||||
this.PortGroupBox.Controls.Add(this.HTTPPortLabel);
|
||||
this.PortGroupBox.Controls.Add(this.HTTPPortTextBox);
|
||||
this.PortGroupBox.Controls.Add(this.Socks5PortLabel);
|
||||
this.PortGroupBox.Controls.Add(this.Socks5PortTextBox);
|
||||
this.PortGroupBox.Location = new System.Drawing.Point(12, 12);
|
||||
this.PortGroupBox.Location = new System.Drawing.Point(18, 18);
|
||||
this.PortGroupBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.PortGroupBox.Name = "PortGroupBox";
|
||||
this.PortGroupBox.Size = new System.Drawing.Size(420, 140);
|
||||
this.PortGroupBox.Padding = new System.Windows.Forms.Padding(4);
|
||||
this.PortGroupBox.Size = new System.Drawing.Size(630, 210);
|
||||
this.PortGroupBox.TabIndex = 0;
|
||||
this.PortGroupBox.TabStop = false;
|
||||
this.PortGroupBox.Text = "Local Port";
|
||||
//
|
||||
// RedirectorLabel
|
||||
//
|
||||
this.RedirectorLabel.AutoSize = true;
|
||||
this.RedirectorLabel.Location = new System.Drawing.Point(9, 110);
|
||||
this.RedirectorLabel.Name = "RedirectorLabel";
|
||||
this.RedirectorLabel.Size = new System.Drawing.Size(95, 17);
|
||||
this.RedirectorLabel.TabIndex = 6;
|
||||
this.RedirectorLabel.Text = "Redirector TCP";
|
||||
//
|
||||
// RedirectorTextBox
|
||||
//
|
||||
this.RedirectorTextBox.Location = new System.Drawing.Point(120, 107);
|
||||
this.RedirectorTextBox.Name = "RedirectorTextBox";
|
||||
this.RedirectorTextBox.Size = new System.Drawing.Size(294, 23);
|
||||
this.RedirectorTextBox.TabIndex = 7;
|
||||
this.RedirectorTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// AllowDevicesCheckBox
|
||||
//
|
||||
this.AllowDevicesCheckBox.AutoSize = true;
|
||||
this.AllowDevicesCheckBox.Location = new System.Drawing.Point(120, 80);
|
||||
this.AllowDevicesCheckBox.Location = new System.Drawing.Point(180, 120);
|
||||
this.AllowDevicesCheckBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.AllowDevicesCheckBox.Name = "AllowDevicesCheckBox";
|
||||
this.AllowDevicesCheckBox.Size = new System.Drawing.Size(206, 21);
|
||||
this.AllowDevicesCheckBox.Size = new System.Drawing.Size(301, 28);
|
||||
this.AllowDevicesCheckBox.TabIndex = 5;
|
||||
this.AllowDevicesCheckBox.Text = "Allow other Devices to connect";
|
||||
this.AllowDevicesCheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
@@ -114,39 +97,44 @@
|
||||
// HTTPPortLabel
|
||||
//
|
||||
this.HTTPPortLabel.AutoSize = true;
|
||||
this.HTTPPortLabel.Location = new System.Drawing.Point(9, 54);
|
||||
this.HTTPPortLabel.Location = new System.Drawing.Point(14, 81);
|
||||
this.HTTPPortLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.HTTPPortLabel.Name = "HTTPPortLabel";
|
||||
this.HTTPPortLabel.Size = new System.Drawing.Size(38, 17);
|
||||
this.HTTPPortLabel.Size = new System.Drawing.Size(55, 24);
|
||||
this.HTTPPortLabel.TabIndex = 3;
|
||||
this.HTTPPortLabel.Text = "HTTP";
|
||||
//
|
||||
// HTTPPortTextBox
|
||||
//
|
||||
this.HTTPPortTextBox.Location = new System.Drawing.Point(120, 51);
|
||||
this.HTTPPortTextBox.Location = new System.Drawing.Point(180, 76);
|
||||
this.HTTPPortTextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.HTTPPortTextBox.Name = "HTTPPortTextBox";
|
||||
this.HTTPPortTextBox.Size = new System.Drawing.Size(294, 23);
|
||||
this.HTTPPortTextBox.Size = new System.Drawing.Size(439, 31);
|
||||
this.HTTPPortTextBox.TabIndex = 4;
|
||||
this.HTTPPortTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// Socks5PortLabel
|
||||
//
|
||||
this.Socks5PortLabel.AutoSize = true;
|
||||
this.Socks5PortLabel.Location = new System.Drawing.Point(9, 25);
|
||||
this.Socks5PortLabel.Location = new System.Drawing.Point(14, 38);
|
||||
this.Socks5PortLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.Socks5PortLabel.Name = "Socks5PortLabel";
|
||||
this.Socks5PortLabel.Size = new System.Drawing.Size(49, 17);
|
||||
this.Socks5PortLabel.Size = new System.Drawing.Size(69, 24);
|
||||
this.Socks5PortLabel.TabIndex = 0;
|
||||
this.Socks5PortLabel.Text = "Socks5";
|
||||
//
|
||||
// Socks5PortTextBox
|
||||
//
|
||||
this.Socks5PortTextBox.Location = new System.Drawing.Point(120, 22);
|
||||
this.Socks5PortTextBox.Location = new System.Drawing.Point(180, 33);
|
||||
this.Socks5PortTextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.Socks5PortTextBox.Name = "Socks5PortTextBox";
|
||||
this.Socks5PortTextBox.Size = new System.Drawing.Size(294, 23);
|
||||
this.Socks5PortTextBox.Size = new System.Drawing.Size(439, 31);
|
||||
this.Socks5PortTextBox.TabIndex = 1;
|
||||
this.Socks5PortTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// TUNTAPGroupBox
|
||||
//
|
||||
this.TUNTAPGroupBox.Controls.Add(this.TUNTAPProxyDNSCheckBox);
|
||||
this.TUNTAPGroupBox.Controls.Add(this.TUNTAPUseCustomDNSCheckBox);
|
||||
this.TUNTAPGroupBox.Controls.Add(this.TUNTAPDNSLabel);
|
||||
this.TUNTAPGroupBox.Controls.Add(this.TUNTAPDNSTextBox);
|
||||
@@ -156,19 +144,33 @@
|
||||
this.TUNTAPGroupBox.Controls.Add(this.TUNTAPNetmaskTextBox);
|
||||
this.TUNTAPGroupBox.Controls.Add(this.TUNTAPAddressLabel);
|
||||
this.TUNTAPGroupBox.Controls.Add(this.TUNTAPAddressTextBox);
|
||||
this.TUNTAPGroupBox.Location = new System.Drawing.Point(12, 158);
|
||||
this.TUNTAPGroupBox.Location = new System.Drawing.Point(18, 237);
|
||||
this.TUNTAPGroupBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.TUNTAPGroupBox.Name = "TUNTAPGroupBox";
|
||||
this.TUNTAPGroupBox.Size = new System.Drawing.Size(420, 164);
|
||||
this.TUNTAPGroupBox.Padding = new System.Windows.Forms.Padding(4);
|
||||
this.TUNTAPGroupBox.Size = new System.Drawing.Size(630, 281);
|
||||
this.TUNTAPGroupBox.TabIndex = 3;
|
||||
this.TUNTAPGroupBox.TabStop = false;
|
||||
this.TUNTAPGroupBox.Text = "TUN/TAP";
|
||||
//
|
||||
// TUNTAPProxyDNSCheckBox
|
||||
//
|
||||
this.TUNTAPProxyDNSCheckBox.AutoSize = true;
|
||||
this.TUNTAPProxyDNSCheckBox.Location = new System.Drawing.Point(180, 243);
|
||||
this.TUNTAPProxyDNSCheckBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.TUNTAPProxyDNSCheckBox.Name = "TUNTAPProxyDNSCheckBox";
|
||||
this.TUNTAPProxyDNSCheckBox.Size = new System.Drawing.Size(221, 28);
|
||||
this.TUNTAPProxyDNSCheckBox.TabIndex = 10;
|
||||
this.TUNTAPProxyDNSCheckBox.Text = "Proxy DNS in Mode 2";
|
||||
this.TUNTAPProxyDNSCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// TUNTAPUseCustomDNSCheckBox
|
||||
//
|
||||
this.TUNTAPUseCustomDNSCheckBox.AutoSize = true;
|
||||
this.TUNTAPUseCustomDNSCheckBox.Location = new System.Drawing.Point(120, 138);
|
||||
this.TUNTAPUseCustomDNSCheckBox.Location = new System.Drawing.Point(180, 207);
|
||||
this.TUNTAPUseCustomDNSCheckBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.TUNTAPUseCustomDNSCheckBox.Name = "TUNTAPUseCustomDNSCheckBox";
|
||||
this.TUNTAPUseCustomDNSCheckBox.Size = new System.Drawing.Size(127, 21);
|
||||
this.TUNTAPUseCustomDNSCheckBox.Size = new System.Drawing.Size(182, 28);
|
||||
this.TUNTAPUseCustomDNSCheckBox.TabIndex = 9;
|
||||
this.TUNTAPUseCustomDNSCheckBox.Text = "Use Custom DNS";
|
||||
this.TUNTAPUseCustomDNSCheckBox.UseVisualStyleBackColor = true;
|
||||
@@ -177,77 +179,86 @@
|
||||
// TUNTAPDNSLabel
|
||||
//
|
||||
this.TUNTAPDNSLabel.AutoSize = true;
|
||||
this.TUNTAPDNSLabel.Location = new System.Drawing.Point(9, 112);
|
||||
this.TUNTAPDNSLabel.Location = new System.Drawing.Point(14, 168);
|
||||
this.TUNTAPDNSLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.TUNTAPDNSLabel.Name = "TUNTAPDNSLabel";
|
||||
this.TUNTAPDNSLabel.Size = new System.Drawing.Size(34, 17);
|
||||
this.TUNTAPDNSLabel.Size = new System.Drawing.Size(49, 24);
|
||||
this.TUNTAPDNSLabel.TabIndex = 7;
|
||||
this.TUNTAPDNSLabel.Text = "DNS";
|
||||
//
|
||||
// TUNTAPDNSTextBox
|
||||
//
|
||||
this.TUNTAPDNSTextBox.Location = new System.Drawing.Point(120, 110);
|
||||
this.TUNTAPDNSTextBox.Location = new System.Drawing.Point(180, 165);
|
||||
this.TUNTAPDNSTextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.TUNTAPDNSTextBox.Name = "TUNTAPDNSTextBox";
|
||||
this.TUNTAPDNSTextBox.Size = new System.Drawing.Size(294, 23);
|
||||
this.TUNTAPDNSTextBox.Size = new System.Drawing.Size(439, 31);
|
||||
this.TUNTAPDNSTextBox.TabIndex = 8;
|
||||
this.TUNTAPDNSTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// TUNTAPGatewayLabel
|
||||
//
|
||||
this.TUNTAPGatewayLabel.AutoSize = true;
|
||||
this.TUNTAPGatewayLabel.Location = new System.Drawing.Point(9, 83);
|
||||
this.TUNTAPGatewayLabel.Location = new System.Drawing.Point(14, 124);
|
||||
this.TUNTAPGatewayLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.TUNTAPGatewayLabel.Name = "TUNTAPGatewayLabel";
|
||||
this.TUNTAPGatewayLabel.Size = new System.Drawing.Size(57, 17);
|
||||
this.TUNTAPGatewayLabel.Size = new System.Drawing.Size(84, 24);
|
||||
this.TUNTAPGatewayLabel.TabIndex = 5;
|
||||
this.TUNTAPGatewayLabel.Text = "Gateway";
|
||||
//
|
||||
// TUNTAPGatewayTextBox
|
||||
//
|
||||
this.TUNTAPGatewayTextBox.Location = new System.Drawing.Point(120, 80);
|
||||
this.TUNTAPGatewayTextBox.Location = new System.Drawing.Point(180, 120);
|
||||
this.TUNTAPGatewayTextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.TUNTAPGatewayTextBox.Name = "TUNTAPGatewayTextBox";
|
||||
this.TUNTAPGatewayTextBox.Size = new System.Drawing.Size(294, 23);
|
||||
this.TUNTAPGatewayTextBox.Size = new System.Drawing.Size(439, 31);
|
||||
this.TUNTAPGatewayTextBox.TabIndex = 6;
|
||||
this.TUNTAPGatewayTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// TUNTAPNetmaskLabel
|
||||
//
|
||||
this.TUNTAPNetmaskLabel.AutoSize = true;
|
||||
this.TUNTAPNetmaskLabel.Location = new System.Drawing.Point(9, 54);
|
||||
this.TUNTAPNetmaskLabel.Location = new System.Drawing.Point(14, 81);
|
||||
this.TUNTAPNetmaskLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.TUNTAPNetmaskLabel.Name = "TUNTAPNetmaskLabel";
|
||||
this.TUNTAPNetmaskLabel.Size = new System.Drawing.Size(60, 17);
|
||||
this.TUNTAPNetmaskLabel.Size = new System.Drawing.Size(87, 24);
|
||||
this.TUNTAPNetmaskLabel.TabIndex = 3;
|
||||
this.TUNTAPNetmaskLabel.Text = "Netmask";
|
||||
//
|
||||
// TUNTAPNetmaskTextBox
|
||||
//
|
||||
this.TUNTAPNetmaskTextBox.Location = new System.Drawing.Point(120, 51);
|
||||
this.TUNTAPNetmaskTextBox.Location = new System.Drawing.Point(180, 76);
|
||||
this.TUNTAPNetmaskTextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.TUNTAPNetmaskTextBox.Name = "TUNTAPNetmaskTextBox";
|
||||
this.TUNTAPNetmaskTextBox.Size = new System.Drawing.Size(294, 23);
|
||||
this.TUNTAPNetmaskTextBox.Size = new System.Drawing.Size(439, 31);
|
||||
this.TUNTAPNetmaskTextBox.TabIndex = 4;
|
||||
this.TUNTAPNetmaskTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// TUNTAPAddressLabel
|
||||
//
|
||||
this.TUNTAPAddressLabel.AutoSize = true;
|
||||
this.TUNTAPAddressLabel.Location = new System.Drawing.Point(9, 25);
|
||||
this.TUNTAPAddressLabel.Location = new System.Drawing.Point(14, 38);
|
||||
this.TUNTAPAddressLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.TUNTAPAddressLabel.Name = "TUNTAPAddressLabel";
|
||||
this.TUNTAPAddressLabel.Size = new System.Drawing.Size(56, 17);
|
||||
this.TUNTAPAddressLabel.Size = new System.Drawing.Size(80, 24);
|
||||
this.TUNTAPAddressLabel.TabIndex = 1;
|
||||
this.TUNTAPAddressLabel.Text = "Address";
|
||||
//
|
||||
// TUNTAPAddressTextBox
|
||||
//
|
||||
this.TUNTAPAddressTextBox.Location = new System.Drawing.Point(120, 22);
|
||||
this.TUNTAPAddressTextBox.Location = new System.Drawing.Point(180, 33);
|
||||
this.TUNTAPAddressTextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.TUNTAPAddressTextBox.Name = "TUNTAPAddressTextBox";
|
||||
this.TUNTAPAddressTextBox.Size = new System.Drawing.Size(294, 23);
|
||||
this.TUNTAPAddressTextBox.Size = new System.Drawing.Size(439, 31);
|
||||
this.TUNTAPAddressTextBox.TabIndex = 2;
|
||||
this.TUNTAPAddressTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// ControlButton
|
||||
//
|
||||
this.ControlButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.ControlButton.Location = new System.Drawing.Point(357, 648);
|
||||
this.ControlButton.Location = new System.Drawing.Point(536, 1018);
|
||||
this.ControlButton.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.ControlButton.Name = "ControlButton";
|
||||
this.ControlButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.ControlButton.Size = new System.Drawing.Size(112, 34);
|
||||
this.ControlButton.TabIndex = 11;
|
||||
this.ControlButton.Text = "Save";
|
||||
this.ControlButton.UseVisualStyleBackColor = true;
|
||||
@@ -256,9 +267,10 @@
|
||||
// GlobalBypassIPsButton
|
||||
//
|
||||
this.GlobalBypassIPsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.GlobalBypassIPsButton.Location = new System.Drawing.Point(12, 648);
|
||||
this.GlobalBypassIPsButton.Location = new System.Drawing.Point(18, 1018);
|
||||
this.GlobalBypassIPsButton.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.GlobalBypassIPsButton.Name = "GlobalBypassIPsButton";
|
||||
this.GlobalBypassIPsButton.Size = new System.Drawing.Size(128, 23);
|
||||
this.GlobalBypassIPsButton.Size = new System.Drawing.Size(192, 34);
|
||||
this.GlobalBypassIPsButton.TabIndex = 10;
|
||||
this.GlobalBypassIPsButton.Text = "Global Bypass IPs";
|
||||
this.GlobalBypassIPsButton.UseVisualStyleBackColor = true;
|
||||
@@ -278,29 +290,71 @@
|
||||
this.BehaviorGroupBox.Controls.Add(this.StartWhenOpenedCheckBox);
|
||||
this.BehaviorGroupBox.Controls.Add(this.StopWhenExitedCheckBox);
|
||||
this.BehaviorGroupBox.Controls.Add(this.ExitWhenClosedCheckBox);
|
||||
this.BehaviorGroupBox.Location = new System.Drawing.Point(12, 330);
|
||||
this.BehaviorGroupBox.Location = new System.Drawing.Point(18, 526);
|
||||
this.BehaviorGroupBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.BehaviorGroupBox.Name = "BehaviorGroupBox";
|
||||
this.BehaviorGroupBox.Size = new System.Drawing.Size(420, 312);
|
||||
this.BehaviorGroupBox.Padding = new System.Windows.Forms.Padding(4);
|
||||
this.BehaviorGroupBox.Size = new System.Drawing.Size(630, 468);
|
||||
this.BehaviorGroupBox.TabIndex = 8;
|
||||
this.BehaviorGroupBox.TabStop = false;
|
||||
this.BehaviorGroupBox.Text = "Behavior";
|
||||
//
|
||||
// STUN_ServerPortTextBox
|
||||
//
|
||||
this.STUN_ServerPortTextBox.Location = new System.Drawing.Point(180, 356);
|
||||
this.STUN_ServerPortTextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.STUN_ServerPortTextBox.Name = "STUN_ServerPortTextBox";
|
||||
this.STUN_ServerPortTextBox.Size = new System.Drawing.Size(439, 31);
|
||||
this.STUN_ServerPortTextBox.TabIndex = 8;
|
||||
this.STUN_ServerPortTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(14, 364);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(157, 24);
|
||||
this.label2.TabIndex = 12;
|
||||
this.label2.Text = "STUN Server Port";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(14, 321);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(116, 24);
|
||||
this.label1.TabIndex = 10;
|
||||
this.label1.Text = "STUN Server";
|
||||
//
|
||||
// RunAtStartup
|
||||
//
|
||||
this.RunAtStartup.AutoSize = true;
|
||||
this.RunAtStartup.Location = new System.Drawing.Point(120, 130);
|
||||
this.RunAtStartup.Location = new System.Drawing.Point(180, 195);
|
||||
this.RunAtStartup.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.RunAtStartup.Name = "RunAtStartup";
|
||||
this.RunAtStartup.Size = new System.Drawing.Size(109, 21);
|
||||
this.RunAtStartup.Size = new System.Drawing.Size(159, 28);
|
||||
this.RunAtStartup.TabIndex = 11;
|
||||
this.RunAtStartup.Text = "Run at startup";
|
||||
this.RunAtStartup.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// STUN_ServerTextBox
|
||||
//
|
||||
this.STUN_ServerTextBox.Location = new System.Drawing.Point(180, 316);
|
||||
this.STUN_ServerTextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.STUN_ServerTextBox.Name = "STUN_ServerTextBox";
|
||||
this.STUN_ServerTextBox.Size = new System.Drawing.Size(439, 31);
|
||||
this.STUN_ServerTextBox.TabIndex = 11;
|
||||
this.STUN_ServerTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// MinimizeWhenStartedCheckBox
|
||||
//
|
||||
this.MinimizeWhenStartedCheckBox.AutoSize = true;
|
||||
this.MinimizeWhenStartedCheckBox.Location = new System.Drawing.Point(120, 103);
|
||||
this.MinimizeWhenStartedCheckBox.Location = new System.Drawing.Point(180, 154);
|
||||
this.MinimizeWhenStartedCheckBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.MinimizeWhenStartedCheckBox.Name = "MinimizeWhenStartedCheckBox";
|
||||
this.MinimizeWhenStartedCheckBox.Size = new System.Drawing.Size(158, 21);
|
||||
this.MinimizeWhenStartedCheckBox.Size = new System.Drawing.Size(233, 28);
|
||||
this.MinimizeWhenStartedCheckBox.TabIndex = 10;
|
||||
this.MinimizeWhenStartedCheckBox.Text = "Minimize when started";
|
||||
this.MinimizeWhenStartedCheckBox.UseVisualStyleBackColor = true;
|
||||
@@ -308,26 +362,29 @@
|
||||
// ProfileCount_Label
|
||||
//
|
||||
this.ProfileCount_Label.AutoSize = true;
|
||||
this.ProfileCount_Label.Location = new System.Drawing.Point(9, 185);
|
||||
this.ProfileCount_Label.Location = new System.Drawing.Point(14, 278);
|
||||
this.ProfileCount_Label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.ProfileCount_Label.Name = "ProfileCount_Label";
|
||||
this.ProfileCount_Label.Size = new System.Drawing.Size(79, 17);
|
||||
this.ProfileCount_Label.Size = new System.Drawing.Size(117, 24);
|
||||
this.ProfileCount_Label.TabIndex = 8;
|
||||
this.ProfileCount_Label.Text = "ProfileCount";
|
||||
//
|
||||
// ProfileCount_TextBox
|
||||
//
|
||||
this.ProfileCount_TextBox.Location = new System.Drawing.Point(222, 182);
|
||||
this.ProfileCount_TextBox.Location = new System.Drawing.Point(333, 273);
|
||||
this.ProfileCount_TextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.ProfileCount_TextBox.Name = "ProfileCount_TextBox";
|
||||
this.ProfileCount_TextBox.Size = new System.Drawing.Size(192, 23);
|
||||
this.ProfileCount_TextBox.Size = new System.Drawing.Size(286, 31);
|
||||
this.ProfileCount_TextBox.TabIndex = 9;
|
||||
this.ProfileCount_TextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// CheckUpdateWhenOpenedCheckBox
|
||||
//
|
||||
this.CheckUpdateWhenOpenedCheckBox.AutoSize = true;
|
||||
this.CheckUpdateWhenOpenedCheckBox.Location = new System.Drawing.Point(120, 157);
|
||||
this.CheckUpdateWhenOpenedCheckBox.Location = new System.Drawing.Point(180, 236);
|
||||
this.CheckUpdateWhenOpenedCheckBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.CheckUpdateWhenOpenedCheckBox.Name = "CheckUpdateWhenOpenedCheckBox";
|
||||
this.CheckUpdateWhenOpenedCheckBox.Size = new System.Drawing.Size(190, 21);
|
||||
this.CheckUpdateWhenOpenedCheckBox.Size = new System.Drawing.Size(277, 28);
|
||||
this.CheckUpdateWhenOpenedCheckBox.TabIndex = 8;
|
||||
this.CheckUpdateWhenOpenedCheckBox.Text = "Check update when opened";
|
||||
this.CheckUpdateWhenOpenedCheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
@@ -336,9 +393,10 @@
|
||||
// StartWhenOpenedCheckBox
|
||||
//
|
||||
this.StartWhenOpenedCheckBox.AutoSize = true;
|
||||
this.StartWhenOpenedCheckBox.Location = new System.Drawing.Point(120, 76);
|
||||
this.StartWhenOpenedCheckBox.Location = new System.Drawing.Point(180, 114);
|
||||
this.StartWhenOpenedCheckBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.StartWhenOpenedCheckBox.Name = "StartWhenOpenedCheckBox";
|
||||
this.StartWhenOpenedCheckBox.Size = new System.Drawing.Size(137, 21);
|
||||
this.StartWhenOpenedCheckBox.Size = new System.Drawing.Size(199, 28);
|
||||
this.StartWhenOpenedCheckBox.TabIndex = 7;
|
||||
this.StartWhenOpenedCheckBox.Text = "Start when opened";
|
||||
this.StartWhenOpenedCheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
@@ -347,9 +405,10 @@
|
||||
// StopWhenExitedCheckBox
|
||||
//
|
||||
this.StopWhenExitedCheckBox.AutoSize = true;
|
||||
this.StopWhenExitedCheckBox.Location = new System.Drawing.Point(120, 49);
|
||||
this.StopWhenExitedCheckBox.Location = new System.Drawing.Point(180, 74);
|
||||
this.StopWhenExitedCheckBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.StopWhenExitedCheckBox.Name = "StopWhenExitedCheckBox";
|
||||
this.StopWhenExitedCheckBox.Size = new System.Drawing.Size(127, 21);
|
||||
this.StopWhenExitedCheckBox.Size = new System.Drawing.Size(185, 28);
|
||||
this.StopWhenExitedCheckBox.TabIndex = 6;
|
||||
this.StopWhenExitedCheckBox.Text = "Stop when exited";
|
||||
this.StopWhenExitedCheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
@@ -358,53 +417,20 @@
|
||||
// ExitWhenClosedCheckBox
|
||||
//
|
||||
this.ExitWhenClosedCheckBox.AutoSize = true;
|
||||
this.ExitWhenClosedCheckBox.Location = new System.Drawing.Point(120, 22);
|
||||
this.ExitWhenClosedCheckBox.Location = new System.Drawing.Point(180, 33);
|
||||
this.ExitWhenClosedCheckBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.ExitWhenClosedCheckBox.Name = "ExitWhenClosedCheckBox";
|
||||
this.ExitWhenClosedCheckBox.Size = new System.Drawing.Size(123, 21);
|
||||
this.ExitWhenClosedCheckBox.Size = new System.Drawing.Size(178, 28);
|
||||
this.ExitWhenClosedCheckBox.TabIndex = 5;
|
||||
this.ExitWhenClosedCheckBox.Text = "Exit when closed";
|
||||
this.ExitWhenClosedCheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.ExitWhenClosedCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(9, 214);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(82, 17);
|
||||
this.label1.TabIndex = 10;
|
||||
this.label1.Text = "STUN Server";
|
||||
//
|
||||
// STUN_ServerTextBox
|
||||
//
|
||||
this.STUN_ServerTextBox.Location = new System.Drawing.Point(120, 211);
|
||||
this.STUN_ServerTextBox.Name = "STUN_ServerTextBox";
|
||||
this.STUN_ServerTextBox.Size = new System.Drawing.Size(294, 23);
|
||||
this.STUN_ServerTextBox.TabIndex = 11;
|
||||
this.STUN_ServerTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(9, 243);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(110, 17);
|
||||
this.label2.TabIndex = 12;
|
||||
this.label2.Text = "STUN Server Port";
|
||||
//
|
||||
// STUN_ServerPortTextBox
|
||||
//
|
||||
this.STUN_ServerPortTextBox.Location = new System.Drawing.Point(120, 237);
|
||||
this.STUN_ServerPortTextBox.Name = "STUN_ServerPortTextBox";
|
||||
this.STUN_ServerPortTextBox.Size = new System.Drawing.Size(294, 23);
|
||||
this.STUN_ServerPortTextBox.TabIndex = 8;
|
||||
this.STUN_ServerPortTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// SettingForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(144F, 144F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.ClientSize = new System.Drawing.Size(444, 682);
|
||||
this.ClientSize = new System.Drawing.Size(666, 1069);
|
||||
this.Controls.Add(this.BehaviorGroupBox);
|
||||
this.Controls.Add(this.PortGroupBox);
|
||||
this.Controls.Add(this.GlobalBypassIPsButton);
|
||||
@@ -413,7 +439,7 @@
|
||||
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.Margin = new System.Windows.Forms.Padding(4, 6, 4, 6);
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "SettingForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
@@ -450,8 +476,6 @@
|
||||
private System.Windows.Forms.Button GlobalBypassIPsButton;
|
||||
private System.Windows.Forms.CheckBox TUNTAPUseCustomDNSCheckBox;
|
||||
private System.Windows.Forms.CheckBox AllowDevicesCheckBox;
|
||||
private System.Windows.Forms.TextBox RedirectorTextBox;
|
||||
private System.Windows.Forms.Label RedirectorLabel;
|
||||
private System.Windows.Forms.GroupBox BehaviorGroupBox;
|
||||
private System.Windows.Forms.CheckBox ExitWhenClosedCheckBox;
|
||||
private System.Windows.Forms.CheckBox StopWhenExitedCheckBox;
|
||||
@@ -465,5 +489,6 @@
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox STUN_ServerTextBox;
|
||||
private System.Windows.Forms.TextBox STUN_ServerPortTextBox;
|
||||
private System.Windows.Forms.CheckBox TUNTAPProxyDNSCheckBox;
|
||||
}
|
||||
}
|
||||
@@ -52,6 +52,7 @@ namespace Netch.Forms
|
||||
TUNTAPNetmaskLabel.Text = Utils.i18N.Translate(TUNTAPNetmaskLabel.Text);
|
||||
TUNTAPGatewayLabel.Text = Utils.i18N.Translate(TUNTAPGatewayLabel.Text);
|
||||
TUNTAPUseCustomDNSCheckBox.Text = Utils.i18N.Translate(TUNTAPUseCustomDNSCheckBox.Text);
|
||||
TUNTAPProxyDNSCheckBox.Text = Utils.i18N.Translate(TUNTAPProxyDNSCheckBox.Text);
|
||||
GlobalBypassIPsButton.Text = Utils.i18N.Translate(GlobalBypassIPsButton.Text);
|
||||
ControlButton.Text = Utils.i18N.Translate(ControlButton.Text);
|
||||
|
||||
@@ -64,13 +65,13 @@ namespace Netch.Forms
|
||||
|
||||
Socks5PortTextBox.Text = Global.Settings.Socks5LocalPort.ToString();
|
||||
HTTPPortTextBox.Text = Global.Settings.HTTPLocalPort.ToString();
|
||||
RedirectorTextBox.Text = Global.Settings.RedirectorTCPPort.ToString();
|
||||
|
||||
TUNTAPAddressTextBox.Text = Global.Settings.TUNTAP.Address;
|
||||
TUNTAPNetmaskTextBox.Text = Global.Settings.TUNTAP.Netmask;
|
||||
TUNTAPGatewayTextBox.Text = Global.Settings.TUNTAP.Gateway;
|
||||
|
||||
TUNTAPUseCustomDNSCheckBox.Checked = Global.Settings.TUNTAP.UseCustomDNS;
|
||||
TUNTAPProxyDNSCheckBox.Checked = Global.Settings.TUNTAP.ProxyDNS;
|
||||
|
||||
BehaviorGroupBox.Text = Utils.i18N.Translate(BehaviorGroupBox.Text);
|
||||
ExitWhenClosedCheckBox.Text = Utils.i18N.Translate(ExitWhenClosedCheckBox.Text);
|
||||
@@ -225,27 +226,6 @@ namespace Netch.Forms
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var RedirectorPort = int.Parse(RedirectorTextBox.Text);
|
||||
|
||||
if (RedirectorPort > 0 && RedirectorPort < 65536)
|
||||
{
|
||||
Global.Settings.RedirectorTCPPort = RedirectorPort;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new FormatException();
|
||||
}
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
RedirectorTextBox.Text = Global.Settings.RedirectorTCPPort.ToString();
|
||||
MessageBox.Show(Utils.i18N.Translate("Port value illegal. Try again."), Utils.i18N.Translate("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (AllowDevicesCheckBox.Checked)
|
||||
{
|
||||
Global.Settings.LocalAddress = "0.0.0.0";
|
||||
@@ -342,10 +322,12 @@ namespace Netch.Forms
|
||||
}
|
||||
|
||||
Global.Settings.TUNTAP.UseCustomDNS = TUNTAPUseCustomDNSCheckBox.Checked;
|
||||
Global.Settings.TUNTAP.ProxyDNS = TUNTAPProxyDNSCheckBox.Checked;
|
||||
|
||||
Utils.Configuration.Save();
|
||||
MessageBox.Show(Utils.i18N.Translate("Saved"), Utils.i18N.Translate("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
Close();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ namespace Netch
|
||||
"table",
|
||||
"rc4",
|
||||
"rc4-md5",
|
||||
"rc4-md5-6",
|
||||
"aes-128-cfb",
|
||||
"aes-192-cfb",
|
||||
"aes-256-cfb",
|
||||
|
||||
@@ -31,6 +31,11 @@ namespace Netch.Models
|
||||
/// 使用自定义 DNS 设置
|
||||
/// </summary>
|
||||
public bool UseCustomDNS = false;
|
||||
|
||||
/// <summary>
|
||||
/// 模式2下是否代理DNS
|
||||
/// </summary>
|
||||
public bool ProxyDNS = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -97,7 +102,7 @@ namespace Netch.Models
|
||||
/// <summary>
|
||||
/// Redirector TCP 占用端口
|
||||
/// </summary>
|
||||
public int RedirectorTCPPort = 2800;
|
||||
//public int RedirectorTCPPort = 2800;
|
||||
|
||||
/// <summary>
|
||||
/// HTTP 和 Socks5 本地代理地址
|
||||
|
||||
@@ -1,101 +1,111 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<UseWPF>true</UseWPF>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<StartupObject>Netch.Netch</StartupObject>
|
||||
<ApplicationManifest>App.manifest</ApplicationManifest>
|
||||
<ApplicationIcon>Netch.ico</ApplicationIcon>
|
||||
<Platforms>x86;x64</Platforms>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<UseWPF>true</UseWPF>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<StartupObject>Netch.Netch</StartupObject>
|
||||
<ApplicationManifest>App.manifest</ApplicationManifest>
|
||||
<ApplicationIcon>Netch.ico</ApplicationIcon>
|
||||
<Platforms>x86;x64</Platforms>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
<NoWarn />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
<NoWarn />
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<NoWarn />
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<NoWarn />
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<NoWarn />
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<NoWarn />
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<NoWarn />
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<NoWarn />
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove=".gitignore" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Remove=".gitignore" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<COMReference Include="TaskScheduler.dll">
|
||||
<Guid>e34cb9f1-c7f7-424c-be29-027dcc09363a</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Lcid>0</Lcid>
|
||||
<Isolated>false</Isolated>
|
||||
<EmbedInteropTypes>false</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<COMReference Include="TaskScheduler.dll">
|
||||
<Guid>e34cb9f1-c7f7-424c-be29-027dcc09363a</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Lcid>0</Lcid>
|
||||
<Isolated>false</Isolated>
|
||||
<EmbedInteropTypes>false</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DNS" Version="5.0.0" />
|
||||
<PackageReference Include="DnsClient" Version="1.2.0" />
|
||||
<PackageReference Include="ini-parser" Version="2.5.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="System.Buffers" Version="4.5.0" />
|
||||
<PackageReference Include="WindowsAPICodePack-Shell" Version="1.1.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DNS" Version="5.0.0" />
|
||||
<PackageReference Include="DnsClient" Version="1.2.0" />
|
||||
<PackageReference Include="ini-parser" Version="2.5.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="System.Buffers" Version="4.5.0" />
|
||||
<PackageReference Include="WindowsAPICodePack-Shell" Version="1.1.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
<Reference Include="System.Web" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
<Reference Include="System.Web" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="Properties\Settings.Designer.cs">
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="@ECHO OFF
RD /S /Q $(TargetDir)bin > NUL 2>&1
RD /S /Q $(TargetDir)i18n > NUL 2>&1
RD /S /Q $(TargetDir)mode > NUL 2>&1

MKDIR $(TargetDir)bin > NUL 2>&1
MKDIR $(TargetDir)i18n > NUL 2>&1
MKDIR $(TargetDir)mode > NUL 2>&1

COPY /Y $(SolutionDir)binaries\$(PlatformName)\* $(TargetDir)bin > NUL 2>&1
COPY /Y $(SolutionDir)binaries\* $(TargetDir)bin > NUL 2>&1
MOVE /Y $(TargetDir)bin\nfapinet.dll $(TargetDir)nfapinet.dll > NUL 2>&1
COPY /Y $(SolutionDir)translations\i18n\* $(TargetDir)i18n > NUL 2>&1
COPY /Y $(SolutionDir)modes\mode\*.txt $(TargetDir)mode > NUL 2>&1
MKDIR $(TargetDir)bin\tap-driver > NUL 2>&1
COPY /Y $(SolutionDir)binaries\$(PlatformName)\tap-driver\* $(TargetDir)bin\tap-driver > NUL 2>&1" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
<ItemGroup>
|
||||
<None Update="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Target Condition="'$(VisualStudioDir)' != ''" Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="@ECHO OFF
RD /S /Q $(TargetDir)bin > NUL 2>&1
RD /S /Q $(TargetDir)i18n > NUL 2>&1
RD /S /Q $(TargetDir)mode > NUL 2>&1

MKDIR $(TargetDir)bin > NUL 2>&1
MKDIR $(TargetDir)i18n > NUL 2>&1
MKDIR $(TargetDir)mode > NUL 2>&1

COPY /Y $(SolutionDir)binaries\$(PlatformName)\* $(TargetDir)bin > NUL 2>&1
COPY /Y $(SolutionDir)binaries\* $(TargetDir)bin > NUL 2>&1
MOVE /Y $(TargetDir)bin\nfapinet.dll $(TargetDir)nfapinet.dll > NUL 2>&1
COPY /Y $(SolutionDir)translations\i18n\* $(TargetDir)i18n > NUL 2>&1
COPY /Y $(SolutionDir)modes\mode\*.txt $(TargetDir)mode > NUL 2>&1
MKDIR $(TargetDir)bin\tap-driver > NUL 2>&1
COPY /Y $(SolutionDir)binaries\$(PlatformName)\tap-driver\* $(TargetDir)bin\tap-driver > NUL 2>&1" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
42
Netch/Properties/Settings.Designer.cs
generated
42
Netch/Properties/Settings.Designer.cs
generated
@@ -1,30 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Netch.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace Netch.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
"Starting netfilter2 Service": "正在启动netfilter2服务",
|
||||
"Starting dns2tcp Service": "正在启动dns2tcp服务",
|
||||
"SetupBypass": "设置绕行规则",
|
||||
"Test failed": "测试失败",
|
||||
"Starting update subscription": "正在更新订阅",
|
||||
"Subscription updated": "订阅更新完毕",
|
||||
|
||||
"Server": "服务器",
|
||||
"Import Servers From Clipboard": "从剪贴板导入服务器",
|
||||
@@ -136,6 +139,7 @@
|
||||
"Netmask": "子网掩码",
|
||||
"Gateway": "网关",
|
||||
"Use Custom DNS": "使用自定义 DNS",
|
||||
"Proxy DNS in Mode 2": "在模式2下代理DNS",
|
||||
"Behavior": "行为",
|
||||
"Exit when closed": "关闭时退出",
|
||||
"Stop when exited": "退出时停止",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Netch
|
||||
[](https://t.me/Netch)
|
||||
|
||||
[](https://t.me/Netch) [](https://t.me/Netch_Discuss_Group) 
|
||||
|
||||
Game accelerator
|
||||
|
||||
[简体中文](docs/README.zh-CN.md) (此版本内容更丰富)
|
||||
@@ -24,8 +24,8 @@ As well, Netch avoid the restricted NAT problem caused by SSTap. You can use an
|
||||
|
||||
[](https://nyancat.info)
|
||||
|
||||
NyanCAT Network,全中转高质量节点,多条低倍率节点保证流量无忧,节点极低延迟涵盖五大洲。Netflix 视频党,游戏党,海外回国党必备,无需年付,月付 19 元起
|
||||
[Telegram 群组](https://t.me/NyanCaaaat)
|
||||
NyanCAT Network,全中转高质量节点,多条低倍率节点保证流量无忧,节点极低延迟涵盖五大洲。Netflix 视频党,游戏党,海外回国党必备,无需年付,月付 19 元起。[测速图](https://t.me/BGP2020/935)
|
||||
[加入 Telegram 群组](https://t.me/NyanCaaaat)
|
||||
|
||||
[](https://www.mansora.net/cart.php)
|
||||
|
||||
|
||||
2
binaries
2
binaries
Submodule binaries updated: afbf683214...f0686ab184
69
build.ps1
Normal file
69
build.ps1
Normal file
@@ -0,0 +1,69 @@
|
||||
# REM The reason we don't use dotnet build is that dotnet build doesn't support COM references yet https://github.com/microsoft/msbuild/issues/3986
|
||||
param([string]$buildtfm = 'all')
|
||||
|
||||
Write-Host 'dotnet SDK version'
|
||||
dotnet --version
|
||||
|
||||
$exe = 'Netch.exe'
|
||||
$mainDir = (Get-Item -Path ".\").FullName
|
||||
$net_baseoutput = "$mainDir\Netch\bin\$configuration"
|
||||
|
||||
Write-Host $mainDir
|
||||
Write-Host $net_baseoutput
|
||||
|
||||
function Build-NetFrameworkx64
|
||||
{
|
||||
Write-Host 'Building .NET Framework x64'
|
||||
|
||||
$outdir = "$net_baseoutput\x64"
|
||||
|
||||
msbuild -v:m -m -t:Build /p:Configuration="Release" /p:Platform="x64" /p:TargetFramework=net48 /p:Runtimeidentifier=win-x64 /restore
|
||||
if ($LASTEXITCODE) { cd $mainDir ; exit $LASTEXITCODE }
|
||||
|
||||
Write-Host 'Build x64 Complete ,Started Copy bin,mode,i18n file'
|
||||
|
||||
Copy-Item "$mainDir\binaries\x64\*" "$net_baseoutput\x64\Release\win-x64\bin"
|
||||
Copy-Item "$mainDir\binaries\x64\tap-driver" "$net_baseoutput\x64\Release\win-x64\bin\tap-driver" -recurse
|
||||
Copy-Item "$mainDir\binaries\*.acl" "$net_baseoutput\x64\Release\win-x64\bin"
|
||||
Copy-Item "$mainDir\binaries\*.conf" "$net_baseoutput\x64\Release\win-x64\bin"
|
||||
Copy-Item "$mainDir\binaries\*.dat" "$net_baseoutput\x64\Release\win-x64\bin"
|
||||
Copy-Item "$mainDir\binaries\*.exe" "$net_baseoutput\x64\Release\win-x64\bin"
|
||||
Move-Item "$net_baseoutput\x64\Release\win-x64\bin\nfapinet.dll" "$net_baseoutput\x64\Release\win-x64\nfapinet.dll"
|
||||
Copy-Item "$mainDir\translations\i18n" "$net_baseoutput\x64\Release\win-x64\i18n" -recurse
|
||||
mkdir "$net_baseoutput\x64\Release\win-x64\mode"
|
||||
Copy-Item "$mainDir\modes\mode\*.txt" "$net_baseoutput\x64\Release\win-x64\mode"
|
||||
|
||||
Write-Host 'x64 ALL DONE'
|
||||
|
||||
}
|
||||
function Build-NetFrameworkx86
|
||||
{
|
||||
Write-Host 'Building .NET Framework x86'
|
||||
|
||||
$outdir = "$net_baseoutput\x86"
|
||||
|
||||
msbuild -v:m -m -t:Build /p:Configuration="Release" /p:Platform="x86" /p:TargetFramework=net48 /p:Runtimeidentifier=win-x86 /restore
|
||||
if ($LASTEXITCODE) { cd $mainDir ; exit $LASTEXITCODE }
|
||||
|
||||
Write-Host 'Build x86 Complete ,Started Copy bin,mode,i18n file'
|
||||
|
||||
Copy-Item "$mainDir\binaries\x86\*" "$net_baseoutput\x86\Release\win-x86\bin"
|
||||
Copy-Item "$mainDir\binaries\x86\tap-driver" "$net_baseoutput\x86\Release\win-x86\bin\tap-driver" -recurse
|
||||
Copy-Item "$mainDir\binaries\*.acl" "$net_baseoutput\x86\Release\win-x86\bin"
|
||||
Copy-Item "$mainDir\binaries\*.conf" "$net_baseoutput\x86\Release\win-x86\bin"
|
||||
Copy-Item "$mainDir\binaries\*.dat" "$net_baseoutput\x86\Release\win-x86\bin"
|
||||
Copy-Item "$mainDir\binaries\*.exe" "$net_baseoutput\x86\Release\win-x86\bin"
|
||||
Move-Item "$net_baseoutput\x86\Release\win-x86\bin\nfapinet.dll" "$net_baseoutput\x86\Release\win-x86\nfapinet.dll"
|
||||
Copy-Item "$mainDir\translations\i18n" "$net_baseoutput\x86\Release\win-x86\i18n" -recurse
|
||||
mkdir "$net_baseoutput\x86\Release\win-x86\mode"
|
||||
Copy-Item "$mainDir\modes\mode\*.txt" "$net_baseoutput\x86\Release\win-x86\mode"
|
||||
|
||||
Write-Host 'x86 ALL DONE'
|
||||
}
|
||||
|
||||
cd $mainDir\Netch
|
||||
|
||||
Build-NetFrameworkx64
|
||||
Build-NetFrameworkx86
|
||||
|
||||
cd $mainDir
|
||||
@@ -25,8 +25,8 @@ Netch 是一款 Windows 平台的开源游戏加速工具,Netch 可以实现
|
||||
|
||||
[](https://nyancat.info)
|
||||
|
||||
NyanCAT Network,全中转高质量节点,多条低倍率节点保证流量无忧,节点极低延迟涵盖五大洲。Netflix 视频党,游戏党,海外回国党必备,无需年付,月付 19 元起
|
||||
[Telegram 群组](https://t.me/NyanCaaaat)
|
||||
NyanCAT Network,全中转高质量节点,多条低倍率节点保证流量无忧,节点极低延迟涵盖五大洲。Netflix 视频党,游戏党,海外回国党必备,无需年付,月付 19 元起。[测速图](https://t.me/BGP2020/935)
|
||||
[加入 Telegram 群组](https://t.me/NyanCaaaat)
|
||||
|
||||
[](https://www.mansora.net/cart.php)
|
||||
|
||||
|
||||
2
modes
2
modes
Submodule modes updated: 9b3ce74bd6...b1366d48be
Reference in New Issue
Block a user