Compare commits

...

175 Commits
5.13 ... 5.38

Author SHA1 Message Date
2dust
ba2eac5290 up 5.38 2022-11-02 19:20:05 +08:00
2dust
23a4e4cc19 refresh ui after update sub 2022-11-02 19:19:26 +08:00
2dust
841a20cbd4 fix naiveproxy redirect output issue 2022-11-02 19:18:31 +08:00
2dust
f70ca77913 add xtls-rprx-vision 2022-11-01 11:32:10 +08:00
2dust
c97df99c5c Merge pull request #2740 from wh201906/patch-1
Add support for config file with .yml extension
2022-10-28 09:11:01 +08:00
Self Not Found
809e170018 Add support for config file with .yml extension 2022-10-28 00:09:25 +08:00
2dust
d0c8f5eb45 Revert "add domainStrategy4Freedoms"
This reverts commit d0f953f1d8.
2022-10-26 19:41:21 +08:00
2dust
d0f953f1d8 add domainStrategy4Freedoms 2022-10-26 19:38:38 +08:00
2dust
6d1636c540 fix update check 2022-10-26 19:09:40 +08:00
2dust
b3292729b0 fix ui 2022-10-15 07:50:48 +08:00
2dust
11840ffc8a up 5.37 2022-10-14 20:47:06 +08:00
2dust
9fd20d1dc8 Add fingerprint(uTLS) option 2022-10-14 20:43:54 +08:00
2dust
ea6799d749 Update README.md 2022-10-10 20:23:37 +08:00
2dust
e23fe00a37 Revert "Merge pull request #2654 from FrzMtrsprt/ArchV3"
This reverts commit ccda957e8f, reversing
changes made to 4dfb0fa213.
2022-09-30 20:22:48 +08:00
2dust
ccda957e8f Merge pull request #2654 from FrzMtrsprt/ArchV3
Make Clash cores use newer microarch level
2022-09-27 20:46:10 +08:00
FrzMtrsprt
cdaaf00509 Make Clash cores use newer microarch level 2022-09-27 18:41:45 +08:00
2dust
4dfb0fa213 Update v2rayN.csproj 2022-09-20 20:25:35 +08:00
2dust
dcda8fc773 Update StatisticsHandler.cs 2022-09-20 20:25:32 +08:00
2dust
9c3fff8510 fix sing-box support 2022-09-20 20:19:31 +08:00
2dust
c3526ebfa3 Merge pull request #2640 from chika0801/master
add sing-box support
2022-09-20 20:04:15 +08:00
chika0801
28ba47a2f5 add sing-box support 2022-09-19 22:57:15 +08:00
chika0801
55a8b9085e add sing-box support 2022-09-19 22:56:15 +08:00
chika0801
2f250c5569 add sing-box support 2022-09-19 22:54:05 +08:00
2dust
e9d0565e6a fix ui 2022-09-13 20:42:30 +08:00
2dust
272de5f34d Update v2rayN.csproj 2022-09-08 20:52:51 +08:00
2dust
60a319a482 Add v2fly_v5 support 2022-09-08 20:52:44 +08:00
2dust
9e440fd5e6 bug fix 2022-08-21 20:15:15 +08:00
2dust
235f20813d Update v2rayN.csproj 2022-08-18 20:31:03 +08:00
2dust
55ce8a3e97 bug fix 2022-08-18 17:11:54 +08:00
2dust
b7ac15ad55 fix 2022-08-18 17:11:36 +08:00
2dust
038b64a416 Merge pull request #2557 from InterestingDarkness/master
Upgrade to SDK-style project format
2022-08-17 20:40:08 +08:00
Computer Idiot
ec2fbca979 Enable v2rayUpgrade dpiAware 2022-08-16 12:45:24 +08:00
Computer Idiot
7f28b1d2c9 Remove unneeded files 2022-08-15 22:27:19 +08:00
Computer Idiot
6a0ec7d294 Remove redundant dependencies introduced by .NET Upgrade Assistant 2022-08-15 22:18:07 +08:00
Computer Idiot
217215b035 Simplify v2rayN.csproj 2022-08-15 21:42:05 +08:00
Computer Idiot
a6fefcacc9 Simplify v2rayUpgrade.csproj 2022-08-15 21:35:38 +08:00
Computer Idiot
03023c04fc Upgrade to SDK-style project format with .NET Upgrade Assistant 2022-08-15 21:33:06 +08:00
2dust
8dadfe6579 Update AssemblyInfo.cs 2022-08-15 19:54:08 +08:00
2dust
6c06de63e4 Restore gui config 2022-08-15 19:53:38 +08:00
2dust
54a122ae34 Improve core tip 2022-08-14 19:36:20 +08:00
2dust
7a0daee443 Merge pull request #2556 from qianxu2001/master
适配 hysteria v1.2.0
2022-08-14 19:15:40 +08:00
qianxu2001
88b5e29092 适配 hysteria v1.2.0
适配 hysteria v1.2.0
2022-08-14 11:01:33 +08:00
2dust
b3ea08dd99 Update v2rayN.csproj 2022-08-13 19:35:56 +08:00
2dust
95794bc5b2 Remove restore location on startup 2022-08-12 20:24:52 +08:00
2dust
3275454bd6 clear auto run 2022-08-12 20:24:15 +08:00
2dust
7f5bb86127 Update v2rayN.csproj 2022-08-06 19:46:47 +08:00
2dust
cf1ae8f240 Update AssemblyInfo.cs 2022-08-05 20:54:04 +08:00
2dust
9b2261918f Refactor UI 2022-08-05 20:53:40 +08:00
2dust
f74071691f Update current group subscription 2022-08-05 20:52:08 +08:00
2dust
6d5e02860e Remember the information filter 2022-08-05 20:50:58 +08:00
2dust
ffa2acb2f5 fix UI 2022-08-05 20:38:03 +08:00
2dust
25b4ff771e fix Pre-Release Updates 2022-08-05 20:28:20 +08:00
2dust
7a48617fea Merge pull request #2530 from InterestingDarkness/master
Add Check for Pre-Release Updates
2022-08-05 20:18:04 +08:00
InterestingDarkness
800807b47a Add Check for Pre-Release Updates 2022-08-05 15:06:44 +08:00
2dust
eaf11c6998 bug fix 2022-08-04 17:07:50 +08:00
2dust
e2053d5a77 Update AssemblyInfo.cs 2022-07-31 20:55:36 +08:00
2dust
ae6b3ef7fb DomainMatcher can be set to empty 2022-07-30 20:27:27 +08:00
2dust
359c6e0f02 delete temporary file 2022-07-30 20:16:13 +08:00
2dust
9a8b4593e1 Fix some issues with update core 2022-07-30 20:12:14 +08:00
2dust
02fc631e3c Merge pull request #2513 from FrzMtrsprt/patch-1
Better README
2022-07-30 19:18:53 +08:00
2dust
19e03a1fdd Merge pull request #2510 from InterestingDarkness/master
Add SagerNet/v2ray-core support
2022-07-30 19:17:57 +08:00
FrzMtrsprt
5ea6279711 Better README
Add release link
Fix grammar
2022-07-30 11:36:54 +08:00
InterestingDarkness
c44578c341 Add update SagerNet-Core functionality 2022-07-29 21:50:37 +08:00
InterestingDarkness
ab34d3fe30 Merge branch '2dust:master' into master 2022-07-29 21:10:59 +08:00
2dust
5aa27c14c6 Update ListViewFlickerFree.cs 2022-07-29 20:59:12 +08:00
2dust
a5e9edb2e5 CheckForDotNetVersion 2022-07-29 20:59:07 +08:00
InterestingDarkness
bbd8ef1f26 Add SagerNet/v2ray-core support 2022-07-29 20:11:39 +08:00
2dust
ad8afa0d3d Update AssemblyInfo.cs 2022-07-28 21:06:37 +08:00
2dust
5198f30363 Add custom configuration to start socks service 2022-07-28 21:05:22 +08:00
2dust
50e55761ab Merge pull request #2501 from Lemonawa/master
fix #2500
2022-07-26 21:04:56 +08:00
Lemonawa
7cb67aa49c Merge branch '2dust:master' into master 2022-07-26 20:34:41 +08:00
Lemonawa
1d4993180a Rename .github/ISSUE_TEMPALTE/02_feature_request.yml to .github/ISSUE_TEMPLATE/02_feature_request.yml 2022-07-26 20:34:24 +08:00
Lemonawa
73a36d5556 Rename .github/ISSUE_TEMPALTE/01_bug_report.yml to .github/ISSUE_TEMPLATE/01_bug_report.yml 2022-07-26 20:33:57 +08:00
2dust
368e489190 Merge pull request #2500 from Lemonawa/master
Update issue templates
2022-07-26 20:08:54 +08:00
2dust
d582d4846e Improve user experience 2022-07-26 20:02:47 +08:00
2dust
87ffad398e add tuic support 2022-07-26 20:02:07 +08:00
Lemonawa
439e7eaca0 Create 02_feature_request.yml 2022-07-26 18:51:36 +08:00
Lemonawa
90d703ae91 Update 01_bug_report.yml 2022-07-26 18:51:08 +08:00
Lemonawa
2d80c90f78 Create 01_bug_report.yml 2022-07-26 18:29:14 +08:00
Lemonawa
b54c8e97bd Delete feature---.md 2022-07-26 18:11:31 +08:00
Lemonawa
58e69a6644 Delete bug---.md 2022-07-26 18:11:22 +08:00
2dust
f09a13259f bug fix 2022-07-25 20:34:12 +08:00
2dust
8775c5e1f2 add Outbound Freedom domainStrategy 2022-07-25 20:34:00 +08:00
2dust
61b7997ae9 Fix notifyicon maxlength issue 2022-07-24 20:38:56 +08:00
2dust
99fa98844c bug fix 2022-07-24 20:11:50 +08:00
2dust
6e5781c633 Update AssemblyInfo.cs 2022-07-04 20:56:04 +08:00
2dust
b58e524d78 bugfix 2022-07-04 20:47:39 +08:00
2dust
0d669af44e Merge pull request #2449 from Miroxyz/master
Update Clash.Meta coreExes
2022-07-04 20:43:32 +08:00
Miro11
a331c70233 Update Clash.Meta coreExes 2022-07-04 14:02:40 +08:00
2dust
fd7d688e6b Improve subscription update 2022-07-03 09:07:48 +08:00
2dust
069d47f01b Update AssemblyInfo.cs 2022-07-02 20:03:13 +08:00
2dust
3079f1c651 Improve subscription update 2022-07-02 20:02:20 +08:00
2dust
f5ecda9255 add exception log 2022-07-02 11:11:23 +08:00
2dust
d83ae315ed refactor traffic statistics 2022-07-02 10:54:27 +08:00
2dust
2b40e87eb9 read handle from reg and show the window 2022-07-01 20:50:47 +08:00
2dust
f7e3eb180b bug fix 2022-07-01 19:57:22 +08:00
2dust
209786cdb6 Vmess 2 VMess 2022-06-30 11:19:55 +08:00
2dust
d418f79d8f fix clash config 2022-06-28 14:44:46 +08:00
2dust
eddd38ff03 Update UpdateHandle.cs 2022-06-26 20:18:43 +08:00
2dust
e4fa729071 Update AssemblyInfo.cs 2022-06-26 09:09:38 +08:00
2dust
b3e7eac895 Parse ss plugin obfs-host 2022-06-24 14:25:09 +08:00
2dust
c43675d987 Sort by test result 2022-06-24 13:56:01 +08:00
2dust
cdaff66126 add rule object doc 2022-06-24 09:54:52 +08:00
2dust
cf45e89b16 Support update clash core 2022-06-24 09:32:55 +08:00
2dust
aec8459761 Revert "Delete v2rayN.csproj"
This reverts commit 25c2871888.
2022-06-23 15:23:41 +08:00
2dust
de746375a9 Merge pull request #2417 from EdiWang/en-translation
Fix English translations
2022-06-23 15:21:07 +08:00
2dust
25c2871888 Delete v2rayN.csproj 2022-06-23 15:20:49 +08:00
2dust
28b2e1a405 Merge pull request #2415 from EdiWang/master
C# language usage improvements
2022-06-23 15:20:18 +08:00
Edi Wang
2603132dae fix English translations 2022-06-22 10:25:19 +08:00
Edi Wang
6f08cb0e88 C sharp language usage improvements 2022-06-22 09:48:00 +08:00
2dust
dd65c3fcaa ss supports transport settings 2022-06-19 20:43:33 +08:00
2dust
fec8641efe Update AssemblyInfo.cs 2022-06-12 19:36:36 +08:00
2dust
d5eaa56b60 refactor update core url 2022-06-06 17:28:38 +08:00
2dust
db7e8dd6dc Update MainFormHandler.cs 2022-06-06 15:10:09 +08:00
2dust
9415055e6f Timeout to 30s 2022-06-05 20:24:08 +08:00
2dust
f597f09914 Support 2022-blake3 share 2022-05-31 14:53:39 +08:00
2dust
7903228c13 Update AssemblyInfo.cs 2022-05-29 18:29:03 +08:00
2dust
4c2388749d add Shadowsocks-2022 for xray-core 2022-05-29 18:28:44 +08:00
2dust
89da3823a4 Update AssemblyInfo.cs 2022-05-29 09:40:34 +08:00
2dust
3a9a49b163 Update MsgFilterSetForm.Designer.cs 2022-05-29 09:40:31 +08:00
2dust
277b21dc86 add server filter 2022-05-29 09:32:31 +08:00
2dust
bc0e8c17ba refactor Move To menu 2022-05-29 08:43:05 +08:00
2dust
51d3df69bb refactor Move To menu 2022-05-29 08:42:22 +08:00
2dust
4913f6f37d rename 2022-05-29 08:33:25 +08:00
2dust
ff622e2ef6 Update v2rayN.csproj 2022-05-29 08:14:16 +08:00
2dust
50ad643abe Update Utils.cs 2022-05-12 09:50:48 +08:00
2dust
944849a381 v2ray_win_temp 2 guiTemp 2022-05-12 09:49:04 +08:00
2dust
6f485141f0 Improve speed test core support 2022-05-12 09:19:03 +08:00
2dust
3575291119 add multiple program auto run 2022-05-12 08:52:40 +08:00
2dust
e256ec5401 Update ConfigHandler.cs 2022-05-06 14:37:52 +08:00
2dust
3defba6290 Update ConfigHandler.cs 2022-05-06 13:35:30 +08:00
2dust
c201d986c5 Update AssemblyInfo.cs 2022-05-06 13:33:29 +08:00
2dust
36aad4424e Fix issue when saving gui config 2022-05-06 10:54:10 +08:00
2dust
b29fb1e2a3 add shadowsocks SIP008 https://shadowsocks.org/en/wiki/SIP008-Online-Configuration-Delivery.html 2022-05-02 20:15:19 +08:00
2dust
d5aa307efb Update AssemblyInfo.cs 2022-05-01 16:22:54 +08:00
2dust
48928613bf bug fix 2022-05-01 09:08:16 +08:00
2dust
52b8f480f6 Fix issue when saving gui config 2022-04-30 08:32:42 +08:00
2dust
bcda8bd602 Update subscription timeout is set to 30 seconds 2022-04-30 08:32:26 +08:00
2dust
2a11fe11e8 Fix issue when saving gui config 2022-04-29 10:58:51 +08:00
2dust
7ec0607fec Update AssemblyInfo.cs 2022-04-27 20:47:38 +08:00
2dust
aa41a8675e Advanced proxy settings, protocol selection (optional) 2022-04-27 20:46:07 +08:00
2dust
19f9bff6fe Support hysteria and naiveproxy subscription 2022-04-27 09:31:38 +08:00
2dust
4e65732a4e Update AssemblyInfo.cs 2022-04-26 20:06:46 +08:00
2dust
47c843bf09 Enable system proxy advanced settings, use socks protocol 2022-04-26 20:06:21 +08:00
2dust
a7741a0b7d Improve notify icon 2022-04-26 14:51:06 +08:00
2dust
6f3fbdfe17 Update AssemblyInfo.cs 2022-04-25 20:27:22 +08:00
2dust
3be93df63f bug fix 2022-04-25 19:07:09 +08:00
2dust
6259539c87 Enable system agent advanced settings 2022-04-25 18:56:09 +08:00
2dust
9654009650 Update HttpClientHelper.cs 2022-04-25 13:24:10 +08:00
2dust
62e796cf5a Update UpdateHandle.cs 2022-04-19 15:54:51 +08:00
2dust
af820bb0f2 Update AssemblyInfo.cs 2022-04-18 19:01:17 +08:00
2dust
8f5bb3591b Improve clone custom configuration 2022-04-18 18:59:41 +08:00
2dust
7eafae98d4 Turn off system proxy when not using proxy to update subscriptions 2022-04-18 18:59:01 +08:00
2dust
1d4e5baafb Domain and IP are automatically sorted when saving 2022-04-18 18:57:56 +08:00
2dust
9894aa053f Update AssemblyInfo.cs 2022-04-17 19:05:11 +08:00
2dust
4ada8fea27 add tray menu servers limit 2022-04-17 19:01:18 +08:00
2dust
4d013a206b Update MainMsgControl.zh-Hans.resx 2022-04-15 20:49:14 +08:00
2dust
2d8a707bed fix bug 2022-04-14 20:08:35 +08:00
2dust
0e55a859ea Update AssemblyInfo.cs 2022-04-14 18:30:15 +08:00
2dust
0b1ec520f4 fix 2022-04-14 17:01:51 +08:00
2dust
fcc5f29882 add auto update sub setting 2022-04-14 16:49:12 +08:00
2dust
d431c63245 Merge pull request #2192 from FrzMtrsprt/patch-1
Add support for Clash's modern CPU executable
2022-04-14 15:08:08 +08:00
FrzMtrsprt
15f8db64e7 Add support for Clash's modern CPU executable
Add support for clash-windows-amd64-v3.exe
2022-04-14 12:13:22 +08:00
2dust
c2ea14151e add naiveproxy 2022-04-14 11:10:06 +08:00
2dust
977f0428e2 Refactor Inbound 2022-04-14 09:56:11 +08:00
2dust
f110446738 Update AssemblyInfo.cs 2022-04-13 19:36:41 +08:00
2dust
90289120d3 add clash.meta core 2022-04-13 09:21:40 +08:00
2dust
688f206555 Refactor main message control 2022-04-13 09:21:17 +08:00
2dust
38c739c45d Improve test 2022-04-12 20:24:48 +08:00
2dust
73c79ca7bf Update AssemblyInfo.cs 2022-04-12 16:58:31 +08:00
2dust
978975ee2d update package 2022-04-12 16:58:09 +08:00
2dust
d7dc0dff50 Adjusting the tray server display 2022-04-12 14:49:57 +08:00
2dust
a3aa6c045f Improve speed test 2022-04-12 13:38:42 +08:00
2dust
785ebc49fc fix clash port 2022-04-12 13:38:10 +08:00
2dust
fde1c98ddd add group sort 2022-04-12 13:37:41 +08:00
97 changed files with 8962 additions and 7371 deletions

View File

@@ -0,0 +1,58 @@
name: Bug 报告
description: 在提出问题前请先自行排除服务器端问题和升级到最新客户端,同时也请通过搜索确认是否有人提出过相同问题。
title: "[Bug]: "
labels: ["bug"]
body:
- type: input
id: "expectation"
attributes:
label: "预期情况"
description: "描述你认为应该发生什么"
validations:
required: true
- type: textarea
id: "describe-the-bug"
attributes:
label: "实际情况"
description: "描述实际发生了什么"
validations:
required: true
- type: textarea
id: "reproduction-method"
attributes:
label: "复现方法"
description: "在BUG出现前执行了哪些操作"
placeholder: 标序号
validations:
required: true
- type: textarea
id: "log"
attributes:
label: "日志信息"
description: "位置在软件当前目录下的guiLogs"
placeholder: 在日志开始和结束位置粘贴冒号后的内容:```
validations:
required: true
- type: textarea
id: "more"
attributes:
label: "额外信息"
description: "可选"
validations:
required: false
- type: checkboxes
id: "latest-version"
attributes:
label: "我确认已更新至最新版本"
description: "否则请更新后尝试"
options:
- label:
required: true
- type: checkboxes
id: "issues"
attributes:
label: "我确认已查询历史issues"
description: "否则请查询后提出"
options:
- label:
required: true

View File

@@ -0,0 +1,34 @@
name: Feature 请求
description: "为这个项目提出一个建议"
title: "[Feature request]: "
labels: ['enhancement']
body:
- type: input
id: problem
attributes:
label: 相关问题
description: "清楚而简洁地描述问题是什么。"
placeholder: "当我想要……时,软件不能……"
validations:
required: true
- type: input
id: way-to-solve
attributes:
label: 描述你希望的解决方案
description: "你希望发生什么"
validations:
required: true
- type: input
id: instead
attributes:
label: 描述你所考虑的替代方案
validations:
required: false
- type: checkboxes
id: "issues"
attributes:
label: "我确认已查询历史issues"
description: "否则请查询后提出"
options:
- label:
required: true

View File

@@ -1,33 +0,0 @@
---
name: Bug 报告
about: 在提出问题前请先自行排除服务器端问题和升级到最新客户端,同时也请通过搜索确认是否有人提出过相同问题。
title: "[BUG]"
labels: bug
assignees: ''
---
在提出问题前请先自行排除服务器端问题和升级到最新客户端,同时也请通过搜索确认是否有人提出过相同问题。
### 预期行为
描述你认为应该发生什么
### 实际行为
描述实际发生了什么
### 复现方法
1.
2.
3.
### 日志信息,位置在当前目录下的guiLogs
<details>
```
在这里粘贴日志
```
</details>
### 环境信息(客户端请升级至最新正式版)
### 额外信息(可选)

View File

@@ -1,20 +0,0 @@
---
name: Feature 请求
about: 为这个项目提出一个建议
title: "[Feature request]"
labels: enhancement
assignees: ''
---
**你的功能请求是否与一个问题有关?请描述。**
清楚而简洁地描述问题是什么。例如。我总是感到沮丧,当 [...]
**描述你希望的解决方案**
对你希望发生的事情进行清晰、简明的描述。
**描述你所考虑的替代方案**
对你考虑过的任何替代解决方案或功能进行清晰、简洁的描述。
**Additional context**
Add any other context or screenshots about the feature request here.

4
.gitignore vendored
View File

@@ -13,6 +13,6 @@
.vs/slnx.sqlite .vs/slnx.sqlite
.vs/VSWorkspaceState.json .vs/VSWorkspaceState.json
/v2rayN/v2rayUpgrade/bin/Debug /v2rayN/v2rayUpgrade/bin/Debug
/v2rayN/v2rayUpgrade/obj/Debug
/v2rayN/v2rayUpgrade/bin/Release /v2rayN/v2rayUpgrade/bin/Release
/v2rayN/v2rayUpgrade/obj/Release /v2rayN/v2rayUpgrade/obj/
*.user

View File

@@ -8,11 +8,14 @@ A V2Ray client for Windows, support [Xray core](https://github.com/XTLS/Xray-cor
[![Chat on Telegram](https://img.shields.io/badge/Chat%20on-Telegram-brightgreen.svg)](https://t.me/v2rayn) [![Chat on Telegram](https://img.shields.io/badge/Chat%20on-Telegram-brightgreen.svg)](https://t.me/v2rayn)
### How to use ### How to use
- If you are newbie please download v2rayN-Core.zip from releases - If you are new to this, please download v2rayN-Core.zip from [releases](https://github.com/2dust/v2rayN/releases)
- Otherwise please download v2rayN.zip (Also need to download v2ray core in the same folder) - Otherwise please download v2rayN.zip (you will also need to download v2ray core into the same folder with v2rayN.exe)
- Run v2rayN.exe - Run v2rayN.exe
### Requirements ### Requirements
- Microsoft [.NET Framework 4.8](https://dotnet.microsoft.com/zh-cn/download/dotnet-framework/thank-you/net48-web-installer) - Microsoft [.NET Framework 4.8 Runtime](https://dotnet.microsoft.com/zh-cn/download/dotnet-framework/thank-you/net48-offline-installer)
- v2fly core [https://github.com/v2fly/v2ray-core/releases](https://github.com/v2fly/v2ray-core/releases) - v2fly core [https://github.com/v2fly/v2ray-core/releases](https://github.com/v2fly/v2ray-core/releases)
- Xray core [https://github.com/XTLS/Xray-core/releases](https://github.com/XTLS/Xray-core/releases) - Xray core [https://github.com/XTLS/Xray-core/releases](https://github.com/XTLS/Xray-core/releases)
### Telegram Channel
[github_2dust](https://t.me/github_2dust)

View File

@@ -16,7 +16,6 @@ namespace v2rayN.Base
{ {
private static HttpClientHelper httpClientHelper = null; private static HttpClientHelper httpClientHelper = null;
private HttpClient httpClient; private HttpClient httpClient;
private int progressPercentage = -1;
/// <summary> /// <summary>
/// </summary> /// </summary>
@@ -46,36 +45,22 @@ namespace v2rayN.Base
{ {
return null; return null;
} }
try HttpResponseMessage response = await httpClient.GetAsync(url);
{
HttpResponseMessage response = await httpClient.GetAsync(url);
return await response.Content.ReadAsStringAsync(); return await response.Content.ReadAsStringAsync();
}
catch
{
}
return null;
} }
public async Task<string> GetAsync(HttpClient client, string url) public async Task<string> GetAsync(HttpClient client, string url, CancellationToken token)
{ {
if (string.IsNullOrEmpty(url)) if (string.IsNullOrEmpty(url))
{ {
return null; return null;
} }
try HttpResponseMessage response = await client.GetAsync(url, token);
if (!response.IsSuccessStatusCode)
{ {
var cts = new CancellationTokenSource(); throw new Exception(string.Format("The request returned with HTTP status code {0}", response.StatusCode));
cts.CancelAfter(5000);
HttpResponseMessage response = await client.GetAsync(url, cts.Token);
return await response.Content.ReadAsStringAsync();
} }
catch (Exception ex) return await response.Content.ReadAsStringAsync();
{
Utils.SaveLog("GetAsync", ex);
}
return null;
} }
public async Task PutAsync(string url, Dictionary<string, string> headers) public async Task PutAsync(string url, Dictionary<string, string> headers)
@@ -120,7 +105,7 @@ namespace v2rayN.Base
var totalRead = 0L; var totalRead = 0L;
var buffer = new byte[1024 * 1024]; var buffer = new byte[1024 * 1024];
var isMoreToRead = true; var isMoreToRead = true;
progressPercentage = -1; var progressPercentage = 0;
do do
{ {
@@ -163,7 +148,7 @@ namespace v2rayN.Base
} }
} }
public async Task DownloadDataAsync4Speed(HttpClient client, string url, IProgress<double> progress, CancellationToken token) public async Task DownloadDataAsync4Speed(HttpClient client, string url, IProgress<string> progress, CancellationToken token)
{ {
if (string.IsNullOrEmpty(url)) if (string.IsNullOrEmpty(url))
{ {
@@ -177,20 +162,30 @@ namespace v2rayN.Base
throw new Exception(string.Format("The request returned with HTTP status code {0}", response.StatusCode)); throw new Exception(string.Format("The request returned with HTTP status code {0}", response.StatusCode));
} }
var total = response.Content.Headers.ContentLength.HasValue ? response.Content.Headers.ContentLength.Value : -1L; //var total = response.Content.Headers.ContentLength.HasValue ? response.Content.Headers.ContentLength.Value : -1L;
var canReportProgress = total != -1 && progress != null; //var canReportProgress = total != -1 && progress != null;
using (var stream = await response.Content.ReadAsStreamAsync()) using (var stream = await response.Content.ReadAsStreamAsync())
{ {
var totalRead = 0L; var totalRead = 0L;
var buffer = new byte[1024 * 128]; var buffer = new byte[1024 * 64];
var isMoreToRead = true; var isMoreToRead = true;
progressPercentage = -1; string progressSpeed = string.Empty;
DateTime totalDatetime = DateTime.Now; DateTime totalDatetime = DateTime.Now;
do do
{ {
token.ThrowIfCancellationRequested(); if (token.IsCancellationRequested)
{
if (totalRead > 0)
{
return;
}
else
{
token.ThrowIfCancellationRequested();
}
}
var read = await stream.ReadAsync(buffer, 0, buffer.Length, token); var read = await stream.ReadAsync(buffer, 0, buffer.Length, token);
@@ -206,14 +201,13 @@ namespace v2rayN.Base
// TODO: // TODO:
totalRead += read; totalRead += read;
if (canReportProgress) TimeSpan ts = (DateTime.Now - totalDatetime);
var speed = (totalRead * 1d / ts.TotalMilliseconds / 1000).ToString("#0.0");
if (progress != null)
{ {
TimeSpan ts = (DateTime.Now - totalDatetime); if (progressSpeed != speed)
var speed = totalRead * 1d / ts.TotalMilliseconds / 1000;
var percent = Convert.ToInt32((totalRead * 1d) / (total * 1d) * 100);
if (progressPercentage != percent && percent % 2 == 1)
{ {
progressPercentage = percent; progressSpeed = speed;
progress.Report(speed); progress.Report(speed);
} }
} }

View File

@@ -16,37 +16,37 @@ namespace v2rayN.Base
UpdateStyles(); UpdateStyles();
} }
public void RegisterDragEvent(Action<int, int> _update) public void RegisterDragEvent(Action<int, int> update)
{ {
_updateFunc = _update; _updateFunc = update;
this.AllowDrop = true; AllowDrop = true;
this.ItemDrag += new ItemDragEventHandler(this.lv_ItemDrag); ItemDrag += lv_ItemDrag;
this.DragDrop += new DragEventHandler(this.lv_DragDrop); DragDrop += lv_DragDrop;
this.DragEnter += new DragEventHandler(this.lv_DragEnter); DragEnter += lv_DragEnter;
this.DragOver += new DragEventHandler(this.lv_DragOver); DragOver += lv_DragOver;
this.DragLeave += new EventHandler(this.lv_DragLeave); DragLeave += lv_DragLeave;
} }
private void lv_DragDrop(object sender, DragEventArgs e) private void lv_DragDrop(object sender, DragEventArgs e)
{ {
int targetIndex = this.InsertionMark.Index; int targetIndex = InsertionMark.Index;
if (targetIndex == -1) if (targetIndex == -1)
{ {
return; return;
} }
if (this.InsertionMark.AppearsAfterItem) if (InsertionMark.AppearsAfterItem)
{ {
targetIndex++; targetIndex++;
} }
if (this.SelectedIndices.Count <= 0) if (SelectedIndices.Count <= 0)
{ {
return; return;
} }
_updateFunc(this.SelectedIndices[0], targetIndex); _updateFunc(SelectedIndices[0], targetIndex);
//ListViewItem draggedItem = (ListViewItem)e.Data.GetData(typeof(ListViewItem)); //ListViewItem draggedItem = (ListViewItem)e.Data.GetData(typeof(ListViewItem));
//this.BeginUpdate(); //this.BeginUpdate();
@@ -63,35 +63,50 @@ namespace v2rayN.Base
private void lv_DragLeave(object sender, EventArgs e) private void lv_DragLeave(object sender, EventArgs e)
{ {
this.InsertionMark.Index = -1; InsertionMark.Index = -1;
} }
private void lv_DragOver(object sender, DragEventArgs e) private void lv_DragOver(object sender, DragEventArgs e)
{ {
Point targetPoint = this.PointToClient(new Point(e.X, e.Y)); Point targetPoint = PointToClient(new Point(e.X, e.Y));
int targetIndex = this.InsertionMark.NearestIndex(targetPoint); int targetIndex = InsertionMark.NearestIndex(targetPoint);
if (targetIndex > -1) if (targetIndex > -1)
{ {
Rectangle itemBounds = this.GetItemRect(targetIndex); Rectangle itemBounds = GetItemRect(targetIndex);
this.EnsureVisible(targetIndex); EnsureVisible(targetIndex);
if (targetPoint.Y > itemBounds.Top + (itemBounds.Height / 2)) if (targetPoint.Y > itemBounds.Top + (itemBounds.Height / 2))
{ {
this.InsertionMark.AppearsAfterItem = true; InsertionMark.AppearsAfterItem = true;
} }
else else
{ {
this.InsertionMark.AppearsAfterItem = false; InsertionMark.AppearsAfterItem = false;
} }
} }
this.InsertionMark.Index = targetIndex; InsertionMark.Index = targetIndex;
} }
private void lv_ItemDrag(object sender, ItemDragEventArgs e) private void lv_ItemDrag(object sender, ItemDragEventArgs e)
{ {
this.DoDragDrop(e.Item, DragDropEffects.Move); DoDragDrop(e.Item, DragDropEffects.Move);
this.InsertionMark.Index = -1; InsertionMark.Index = -1;
}
public void SetScrollPosition(int pos)
{
pos = Math.Min(Items.Count - 1, pos);
if (pos < 0 || pos >= Items.Count)
return;
EnsureVisible(pos);
for (int i = 0; i < 10; i++)
{
if (TopItem != null && TopItem.Index != pos)
TopItem = Items[pos];
}
} }
} }
} }

View File

@@ -31,6 +31,9 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddServer2Form)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddServer2Form));
this.btnClose = new System.Windows.Forms.Button(); this.btnClose = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.txtPreSocksPort = new System.Windows.Forms.TextBox();
this.btnEdit = new System.Windows.Forms.Button(); this.btnEdit = new System.Windows.Forms.Button();
this.cmbCoreType = new System.Windows.Forms.ComboBox(); this.cmbCoreType = new System.Windows.Forms.ComboBox();
this.labCoreType = new System.Windows.Forms.Label(); this.labCoreType = new System.Windows.Forms.Label();
@@ -49,14 +52,18 @@
// //
// btnClose // btnClose
// //
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose"); resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnClose.Name = "btnClose"; this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true; this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click); this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
// //
// groupBox1 // groupBox1
// //
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.txtPreSocksPort);
this.groupBox1.Controls.Add(this.btnEdit); this.groupBox1.Controls.Add(this.btnEdit);
this.groupBox1.Controls.Add(this.cmbCoreType); this.groupBox1.Controls.Add(this.cmbCoreType);
this.groupBox1.Controls.Add(this.labCoreType); this.groupBox1.Controls.Add(this.labCoreType);
@@ -66,10 +73,24 @@
this.groupBox1.Controls.Add(this.txtRemarks); this.groupBox1.Controls.Add(this.txtRemarks);
this.groupBox1.Controls.Add(this.label6); this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.label1);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
// //
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// txtPreSocksPort
//
resources.ApplyResources(this.txtPreSocksPort, "txtPreSocksPort");
this.txtPreSocksPort.Name = "txtPreSocksPort";
//
// btnEdit // btnEdit
// //
resources.ApplyResources(this.btnEdit, "btnEdit"); resources.ApplyResources(this.btnEdit, "btnEdit");
@@ -79,9 +100,9 @@
// //
// cmbCoreType // cmbCoreType
// //
resources.ApplyResources(this.cmbCoreType, "cmbCoreType");
this.cmbCoreType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType.FormattingEnabled = true; this.cmbCoreType.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType, "cmbCoreType");
this.cmbCoreType.Name = "cmbCoreType"; this.cmbCoreType.Name = "cmbCoreType";
// //
// labCoreType // labCoreType
@@ -123,9 +144,9 @@
// //
// panel2 // panel2
// //
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.btnClose); this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK); this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2"; this.panel2.Name = "panel2";
// //
// btnOK // btnOK
@@ -174,5 +195,8 @@
private System.Windows.Forms.ComboBox cmbCoreType; private System.Windows.Forms.ComboBox cmbCoreType;
private System.Windows.Forms.Label labCoreType; private System.Windows.Forms.Label labCoreType;
private System.Windows.Forms.Button btnEdit; private System.Windows.Forms.Button btnEdit;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtPreSocksPort;
private System.Windows.Forms.Label label3;
} }
} }

View File

@@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
@@ -18,9 +19,15 @@ namespace v2rayN.Forms
private void AddServer2Form_Load(object sender, EventArgs e) private void AddServer2Form_Load(object sender, EventArgs e)
{ {
cmbCoreType.Items.AddRange(Global.coreTypes.ToArray()); List<string> coreTypes = new List<string>();
cmbCoreType.Items.Add("clash"); foreach (ECoreType it in Enum.GetValues(typeof(ECoreType)))
cmbCoreType.Items.Add("hysteria"); {
if (it == ECoreType.v2rayN)
continue;
coreTypes.Add(it.ToString());
}
cmbCoreType.Items.AddRange(coreTypes.ToArray());
cmbCoreType.Items.Add(string.Empty); cmbCoreType.Items.Add(string.Empty);
txtAddress.ReadOnly = true; txtAddress.ReadOnly = true;
@@ -30,8 +37,10 @@ namespace v2rayN.Forms
} }
else else
{ {
vmessItem = new VmessItem(); vmessItem = new VmessItem
vmessItem.groupId = groupId; {
groupId = groupId
};
ClearServer(); ClearServer();
} }
} }
@@ -43,15 +52,9 @@ namespace v2rayN.Forms
{ {
txtRemarks.Text = vmessItem.remarks; txtRemarks.Text = vmessItem.remarks;
txtAddress.Text = vmessItem.address; txtAddress.Text = vmessItem.address;
txtPreSocksPort.Text = vmessItem.preSocksPort.ToString();
if (vmessItem.coreType == null) cmbCoreType.Text = vmessItem.coreType == null ? string.Empty : vmessItem.coreType.ToString();
{
cmbCoreType.Text = string.Empty;
}
else
{
cmbCoreType.Text = vmessItem.coreType.ToString();
}
} }
@@ -77,6 +80,8 @@ namespace v2rayN.Forms
return; return;
} }
vmessItem.remarks = remarks; vmessItem.remarks = remarks;
vmessItem.preSocksPort = Utils.ToInt(txtPreSocksPort.Text);
if (Utils.IsNullOrEmpty(cmbCoreType.Text)) if (Utils.IsNullOrEmpty(cmbCoreType.Text))
{ {
vmessItem.coreType = null; vmessItem.coreType = null;
@@ -88,7 +93,7 @@ namespace v2rayN.Forms
if (ConfigHandler.EditCustomServer(ref config, vmessItem) == 0) if (ConfigHandler.EditCustomServer(ref config, vmessItem) == 0)
{ {
this.DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }
else else
{ {
@@ -98,14 +103,7 @@ namespace v2rayN.Forms
private void btnClose_Click(object sender, EventArgs e) private void btnClose_Click(object sender, EventArgs e)
{ {
if (Utils.IsNullOrEmpty(vmessItem.indexId)) DialogResult = Utils.IsNullOrEmpty(vmessItem.indexId) ? DialogResult.Cancel : DialogResult.OK;
{
this.DialogResult = DialogResult.Cancel;
}
else
{
this.DialogResult = DialogResult.OK;
}
} }
private void btnBrowse_Click(object sender, EventArgs e) private void btnBrowse_Click(object sender, EventArgs e)
@@ -115,7 +113,7 @@ namespace v2rayN.Forms
OpenFileDialog fileDialog = new OpenFileDialog OpenFileDialog fileDialog = new OpenFileDialog
{ {
Multiselect = false, Multiselect = false,
Filter = "Config|*.json|YAML|*.yaml|All|*.*" Filter = "Config|*.json|YAML|*.yaml;*.yml|All|*.*"
}; };
if (fileDialog.ShowDialog() != DialogResult.OK) if (fileDialog.ShowDialog() != DialogResult.OK)
{ {
@@ -150,7 +148,7 @@ namespace v2rayN.Forms
return; return;
} }
address = Path.Combine(Utils.GetConfigPath(), address); address = Utils.GetConfigPath(address);
Process.Start(address); Process.Start(address);
} }
} }

View File

@@ -118,390 +118,456 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label13.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 12</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>370, 41</value>
</data>
<data name="&gt;&gt;label6.Name" xml:space="preserve">
<value>label6</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="labCoreType.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 12</value>
</data>
<data name="&gt;&gt;cmbCoreType.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>* After setting this value, an socks service will be started using V2ray to provide functions such as speed display</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labCoreType.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="labCoreType.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnBrowse.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;label6.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="cmbCoreType.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 157</value>
</data>
<data name="txtAddress.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 62</value>
</data>
<data name="&gt;&gt;label13.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="labCoreType.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Custom configuration server</value>
</data>
<data name="btnBrowse.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 110</value>
</data>
<data name="label3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>11</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>357, 17</value>
</data>
<data name="&gt;&gt;panel1.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>46</value>
</data>
<data name="&gt;&gt;btnBrowse.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="txtAddress.Size" type="System.Drawing.Size, System.Drawing">
<value>432, 37</value>
</data>
<data name="&gt;&gt;labCoreType.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtPreSocksPort.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing"> <data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>450, 17</value> <value>450, 17</value>
</data> </data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing"> <data name="btnEdit.TabIndex" type="System.Int32, mscorlib">
<value>43</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;txtPreSocksPort.Name" xml:space="preserve">
<value>txtPreSocksPort</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>611, 60</value>
</data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="txtPreSocksPort.TabIndex" type="System.Int32, mscorlib">
<value>45</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label13.TabIndex" type="System.Int32, mscorlib">
<value>22</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value> <value>75, 23</value>
</data> </data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <data name="btnEdit.Location" type="System.Drawing.Point, System.Drawing">
<data name="btnClose.TabIndex" type="System.Int32, mscorlib"> <value>208, 110</value>
<value>4</value>
</data> </data>
<data name="btnClose.Text" xml:space="preserve"> <data name="btnEdit.Text" xml:space="preserve">
<value>&amp;Cancel</value> <value>&amp;Edit</value>
</data> </data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve"> <data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>btnClose</value> <value>2</value>
</data> </data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve"> <data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="label6.Text" xml:space="preserve">
<value>Alias (remarks)</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>313, 21</value>
</data>
<data name="&gt;&gt;label13.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="btnBrowse.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="cmbCoreType.TabIndex" type="System.Int32, mscorlib">
<value>41</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 62</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>AddServer2Form</value>
</data>
<data name="label13.Location" type="System.Drawing.Point, System.Drawing">
<value>446, 26</value>
</data>
<data name="&gt;&gt;btnBrowse.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtAddress.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labCoreType.Name" xml:space="preserve">
<value>labCoreType</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value>
</data>
<data name="cmbCoreType.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 20</value>
</data>
<data name="&gt;&gt;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="labCoreType.TabIndex" type="System.Int32, mscorlib">
<value>42</value>
</data>
<data name="&gt;&gt;btnEdit.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve"> <data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel2</value> <value>panel2</value>
</data> </data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve"> <data name="txtPreSocksPort.Size" type="System.Drawing.Size, System.Drawing">
<value>0</value> <value>89, 21</value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<data name="btnEdit.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <value>611, 10</value>
<value>NoControl</value>
</data> </data>
<data name="btnEdit.Location" type="System.Drawing.Point, System.Drawing"> <data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>208, 110</value> <value>0, 10</value>
</data>
<data name="btnEdit.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnEdit.TabIndex" type="System.Int32, mscorlib">
<value>43</value>
</data>
<data name="btnEdit.Text" xml:space="preserve">
<value>&amp;Edit</value>
</data>
<data name="&gt;&gt;btnEdit.Name" xml:space="preserve">
<value>btnEdit</value>
</data>
<data name="&gt;&gt;btnEdit.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnEdit.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;btnEdit.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="cmbCoreType.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 157</value>
</data>
<data name="cmbCoreType.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 20</value>
</data>
<data name="cmbCoreType.TabIndex" type="System.Int32, mscorlib">
<value>41</value>
</data>
<data name="&gt;&gt;cmbCoreType.Name" xml:space="preserve">
<value>cmbCoreType</value>
</data>
<data name="&gt;&gt;cmbCoreType.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmbCoreType.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;cmbCoreType.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="labCoreType.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="labCoreType.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="labCoreType.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 161</value>
</data>
<data name="labCoreType.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 12</value>
</data>
<data name="labCoreType.TabIndex" type="System.Int32, mscorlib">
<value>42</value>
</data> </data>
<data name="labCoreType.Text" xml:space="preserve"> <data name="labCoreType.Text" xml:space="preserve">
<value>Core Type</value> <value>Core Type</value>
</data> </data>
<data name="&gt;&gt;labCoreType.Name" xml:space="preserve"> <data name="txtPreSocksPort.Location" type="System.Drawing.Point, System.Drawing">
<value>labCoreType</value> <value>127, 195</value>
</data> </data>
<data name="&gt;&gt;labCoreType.Type" xml:space="preserve"> <data name="btnEdit.Size" type="System.Drawing.Size, System.Drawing">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labCoreType.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;labCoreType.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="btnBrowse.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnBrowse.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 110</value>
</data>
<data name="btnBrowse.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value> <value>75, 23</value>
</data> </data>
<data name="btnBrowse.TabIndex" type="System.Int32, mscorlib"> <data name="&gt;&gt;cmbCoreType.Parent" xml:space="preserve">
<value>40</value>
</data>
<data name="btnBrowse.Text" xml:space="preserve">
<value>&amp;Browse</value>
</data>
<data name="&gt;&gt;btnBrowse.Name" xml:space="preserve">
<value>btnBrowse</value>
</data>
<data name="&gt;&gt;btnBrowse.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnBrowse.Parent" xml:space="preserve">
<value>groupBox1</value> <value>groupBox1</value>
</data> </data>
<data name="&gt;&gt;btnBrowse.ZOrder" xml:space="preserve"> <data name="&gt;&gt;btnBrowse.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="txtAddress.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 62</value>
</data>
<data name="txtAddress.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtAddress.Size" type="System.Drawing.Size, System.Drawing">
<value>432, 37</value>
</data>
<data name="txtAddress.TabIndex" type="System.Int32, mscorlib">
<value>23</value>
</data>
<data name="&gt;&gt;txtAddress.Name" xml:space="preserve">
<value>txtAddress</value>
</data>
<data name="&gt;&gt;txtAddress.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtAddress.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtAddress.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="label13.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label13.Location" type="System.Drawing.Point, System.Drawing">
<value>446, 26</value>
</data>
<data name="label13.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 12</value>
</data>
<data name="label13.TabIndex" type="System.Int32, mscorlib">
<value>22</value>
</data>
<data name="label13.Text" xml:space="preserve">
<value>* Fill in manually</value>
</data>
<data name="&gt;&gt;label13.Name" xml:space="preserve">
<value>label13</value>
</data>
<data name="&gt;&gt;label13.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label13.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label13.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 23</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>313, 21</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>6</value> <value>6</value>
</data> </data>
<data name="label6.AutoSize" type="System.Boolean, mscorlib"> <data name="&gt;&gt;btnEdit.Name" xml:space="preserve">
<value>True</value> <value>btnEdit</value>
</data> </data>
<data name="label6.Location" type="System.Drawing.Point, System.Drawing"> <data name="btnOK.Text" xml:space="preserve">
<value>12, 27</value> <value>&amp;OK</value>
</data> </data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing"> <data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>95, 12</value> <value>btnClose</value>
</data> </data>
<data name="label6.TabIndex" type="System.Int32, mscorlib"> <data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>10</value> <value>$this</value>
</data>
<data name="label6.Text" xml:space="preserve">
<value>Alias (remarks)</value>
</data>
<data name="&gt;&gt;label6.Name" xml:space="preserve">
<value>label6</value>
</data>
<data name="&gt;&gt;label6.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label6.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label6.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 62</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data> </data>
<data name="label1.TabIndex" type="System.Int32, mscorlib"> <data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>0</value> <value>0</value>
</data> </data>
<data name="label1.Text" xml:space="preserve"> <data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>Address</value> <value>229, 189</value>
</data> </data>
<data name="&gt;&gt;label1.Name" xml:space="preserve"> <data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>label1</value> <value>44</value>
</data> </data>
<data name="&gt;&gt;label1.Type" xml:space="preserve"> <data name="txtAddress.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="labCoreType.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 161</value>
</data>
<data name="&gt;&gt;label13.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="txtAddress.TabIndex" type="System.Int32, mscorlib">
<value>23</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;cmbCoreType.Name" xml:space="preserve">
<value>cmbCoreType</value>
</data>
<data name="btnBrowse.Text" xml:space="preserve">
<value>&amp;Browse</value>
</data>
<data name="&gt;&gt;label6.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve"> <data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>groupBox1</value> <value>groupBox1</value>
</data> </data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve"> <data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>8</value> <value>v2rayN.Forms.BaseServerForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>Fill</value> <value>label3</value>
</data> </data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing"> <data name="label2.Text" xml:space="preserve">
<value>0, 10</value> <value>Pre-Socks Port</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>611, 189</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Server</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 199</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>611, 60</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data> </data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve"> <data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>357, 17</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value> <value>Top</value>
</data> </data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing"> <data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value> <value>0, 259</value>
</data> </data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing"> <data name="&gt;&gt;txtAddress.ZOrder" xml:space="preserve">
<value>611, 10</value> <value>7</value>
</data> </data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib"> <data name="btnEdit.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>6</value> <value>NoControl</value>
</data> </data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve"> <data name="&gt;&gt;labCoreType.Parent" xml:space="preserve">
<value>panel1</value> <value>groupBox1</value>
</data> </data>
<data name="&gt;&gt;panel1.Type" xml:space="preserve"> <data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>47, 12</value>
</data> </data>
<data name="&gt;&gt;panel1.Parent" xml:space="preserve"> <data name="label13.AutoSize" type="System.Boolean, mscorlib">
<value>$this</value> <value>True</value>
</data> </data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve"> <data name="&gt;&gt;txtPreSocksPort.Type" xml:space="preserve">
<value>2</value> <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Address</value>
</data>
<data name="&gt;&gt;btnEdit.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 23</value>
</data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value>
</data>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmbCoreType.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="label13.Text" xml:space="preserve">
<value>* Fill in manually</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;txtPreSocksPort.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 199</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>611, 319</value>
</data>
<data name="&gt;&gt;btnBrowse.Name" xml:space="preserve">
<value>btnBrowse</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>611, 249</value>
</data>
<data name="btnBrowse.TabIndex" type="System.Int32, mscorlib">
<value>40</value>
</data>
<data name="&gt;&gt;label6.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;label13.Name" xml:space="preserve">
<value>label13</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="label2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>9</value>
</data>
<data name="&gt;&gt;btnEdit.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtAddress.Name" xml:space="preserve">
<value>txtAddress</value>
</data>
<data name="&gt;&gt;txtAddress.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Server</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="label6.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="label6.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 27</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>611, 259</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Custom configuration server</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>AddServer2Form</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseServerForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
</root> </root>

View File

@@ -117,34 +117,56 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="$this.Text" xml:space="preserve">
<value>自定义配置</value>
</data>
<data name="btnBrowse.Text" xml:space="preserve">
<value>浏览(&amp;B)</value>
</data>
<data name="btnClose.Text" xml:space="preserve"> <data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value> <value>取消(&amp;C)</value>
</data> </data>
<data name="btnEdit.Text" xml:space="preserve">
<value>编辑(&amp;E)</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="groupBox1.Text" xml:space="preserve"> <data name="groupBox1.Text" xml:space="preserve">
<value>服务器</value> <value>服务器</value>
</data> </data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>337, 41</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>* 自定义配置的Socks端口值可不设置当设置此值后将使用V2ray-core额外启动一个前置Socks服务提供分流和速度显示等功能</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 12</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Socks端口</value>
</data>
<data name="btnEdit.Text" xml:space="preserve">
<value>编辑(&amp;E)</value>
</data>
<data name="labCoreType.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="labCoreType.Text" xml:space="preserve"> <data name="labCoreType.Text" xml:space="preserve">
<value>Core类型</value> <value>Core类型</value>
</data> </data>
<data name="label1.Text" xml:space="preserve"> <data name="btnBrowse.Text" xml:space="preserve">
<value>地址(address)</value> <value>浏览(&amp;B)</value>
</data> </data>
<data name="label13.Text" xml:space="preserve"> <data name="label13.Text" xml:space="preserve">
<value>*手填,方便识别管理</value> <value>*手填,方便识别管理</value>
</data> </data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 12</value>
</data>
<data name="label6.Text" xml:space="preserve"> <data name="label6.Text" xml:space="preserve">
<value>别名(remarks)</value> <value>别名(remarks)</value>
</data> </data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 12</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>地址(address)</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>自定义配置</value>
</data>
</root> </root>

View File

@@ -65,6 +65,8 @@
this.cmbSecurity = new System.Windows.Forms.ComboBox(); this.cmbSecurity = new System.Windows.Forms.ComboBox();
this.label5 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label();
this.panAddr = new System.Windows.Forms.Panel(); this.panAddr = new System.Windows.Forms.Panel();
this.cmbCoreType = new System.Windows.Forms.ComboBox();
this.labCoreType = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.txtAddress = new System.Windows.Forms.TextBox(); this.txtAddress = new System.Windows.Forms.TextBox();
@@ -76,8 +78,6 @@
this.panTop = new System.Windows.Forms.Panel(); this.panTop = new System.Windows.Forms.Panel();
this.panTran = new System.Windows.Forms.Panel(); this.panTran = new System.Windows.Forms.Panel();
this.transportControl = new v2rayN.Forms.ServerTransportControl(); this.transportControl = new v2rayN.Forms.ServerTransportControl();
this.cmbCoreType = new System.Windows.Forms.ComboBox();
this.labCoreType = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.panSocks.SuspendLayout(); this.panSocks.SuspendLayout();
this.panSs.SuspendLayout(); this.panSs.SuspendLayout();
@@ -329,6 +329,18 @@
resources.ApplyResources(this.panAddr, "panAddr"); resources.ApplyResources(this.panAddr, "panAddr");
this.panAddr.Name = "panAddr"; this.panAddr.Name = "panAddr";
// //
// cmbCoreType
//
this.cmbCoreType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType, "cmbCoreType");
this.cmbCoreType.Name = "cmbCoreType";
//
// labCoreType
//
resources.ApplyResources(this.labCoreType, "labCoreType");
this.labCoreType.Name = "labCoreType";
//
// label6 // label6
// //
resources.ApplyResources(this.label6, "label6"); resources.ApplyResources(this.label6, "label6");
@@ -390,18 +402,6 @@
resources.ApplyResources(this.transportControl, "transportControl"); resources.ApplyResources(this.transportControl, "transportControl");
this.transportControl.Name = "transportControl"; this.transportControl.Name = "transportControl";
// //
// cmbCoreType
//
this.cmbCoreType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType, "cmbCoreType");
this.cmbCoreType.Name = "cmbCoreType";
//
// labCoreType
//
resources.ApplyResources(this.labCoreType, "labCoreType");
this.labCoreType.Name = "labCoreType";
//
// AddServerForm // AddServerForm
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");

View File

@@ -16,14 +16,14 @@ namespace v2rayN.Forms
private void AddServerForm_Load(object sender, EventArgs e) private void AddServerForm_Load(object sender, EventArgs e)
{ {
this.Text = (eConfigType).ToString(); Text = (eConfigType).ToString();
cmbCoreType.Items.AddRange(Global.coreTypes.ToArray()); cmbCoreType.Items.AddRange(Global.coreTypes.ToArray());
cmbCoreType.Items.Add(string.Empty); cmbCoreType.Items.Add(string.Empty);
switch (eConfigType) switch (eConfigType)
{ {
case EConfigType.Vmess: case EConfigType.VMess:
panVmess.Dock = DockStyle.Fill; panVmess.Dock = DockStyle.Fill;
panVmess.Visible = true; panVmess.Visible = true;
@@ -32,16 +32,16 @@ namespace v2rayN.Forms
case EConfigType.Shadowsocks: case EConfigType.Shadowsocks:
panSs.Dock = DockStyle.Fill; panSs.Dock = DockStyle.Fill;
panSs.Visible = true; panSs.Visible = true;
panTran.Visible = false; //panTran.Visible = false;
this.Height = this.Height - panTran.Height; //this.Height = this.Height - panTran.Height;
cmbSecurity3.Items.AddRange(LazyConfig.Instance.GetShadowsocksSecuritys().ToArray()); cmbSecurity3.Items.AddRange(LazyConfig.Instance.GetShadowsocksSecuritys(vmessItem).ToArray());
break; break;
case EConfigType.Socks: case EConfigType.Socks:
panSocks.Dock = DockStyle.Fill; panSocks.Dock = DockStyle.Fill;
panSocks.Visible = true; panSocks.Visible = true;
panTran.Visible = false; panTran.Visible = false;
this.Height = this.Height - panTran.Height; Height = Height - panTran.Height;
break; break;
case EConfigType.VLESS: case EConfigType.VLESS:
panVless.Dock = DockStyle.Fill; panVless.Dock = DockStyle.Fill;
@@ -65,8 +65,10 @@ namespace v2rayN.Forms
} }
else else
{ {
vmessItem = new VmessItem(); vmessItem = new VmessItem
vmessItem.groupId = groupId; {
groupId = groupId
};
ClearServer(); ClearServer();
} }
} }
@@ -82,7 +84,7 @@ namespace v2rayN.Forms
switch (eConfigType) switch (eConfigType)
{ {
case EConfigType.Vmess: case EConfigType.VMess:
txtId.Text = vmessItem.id; txtId.Text = vmessItem.id;
txtAlterId.Text = vmessItem.alterId.ToString(); txtAlterId.Text = vmessItem.alterId.ToString();
cmbSecurity.Text = vmessItem.security; cmbSecurity.Text = vmessItem.security;
@@ -106,14 +108,7 @@ namespace v2rayN.Forms
break; break;
} }
if (vmessItem.coreType == null) cmbCoreType.Text = vmessItem.coreType == null ? string.Empty : vmessItem.coreType.ToString();
{
cmbCoreType.Text = string.Empty;
}
else
{
cmbCoreType.Text = vmessItem.coreType.ToString();
}
transportControl.BindingServer(vmessItem); transportControl.BindingServer(vmessItem);
} }
@@ -129,7 +124,7 @@ namespace v2rayN.Forms
switch (eConfigType) switch (eConfigType)
{ {
case EConfigType.Vmess: case EConfigType.VMess:
txtId.Text = ""; txtId.Text = "";
txtAlterId.Text = "0"; txtAlterId.Text = "0";
cmbSecurity.Text = Global.DefaultSecurity; cmbSecurity.Text = Global.DefaultSecurity;
@@ -169,7 +164,7 @@ namespace v2rayN.Forms
switch (eConfigType) switch (eConfigType)
{ {
case EConfigType.Vmess: case EConfigType.VMess:
id = txtId.Text; id = txtId.Text;
alterId = txtAlterId.Text; alterId = txtAlterId.Text;
security = cmbSecurity.Text; security = cmbSecurity.Text;
@@ -246,7 +241,7 @@ namespace v2rayN.Forms
int ret = -1; int ret = -1;
switch (eConfigType) switch (eConfigType)
{ {
case EConfigType.Vmess: case EConfigType.VMess:
ret = ConfigHandler.AddServer(ref config, vmessItem); ret = ConfigHandler.AddServer(ref config, vmessItem);
break; break;
case EConfigType.Shadowsocks: case EConfigType.Shadowsocks:
@@ -267,7 +262,7 @@ namespace v2rayN.Forms
if (ret == 0) if (ret == 0)
{ {
this.DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }
else else
{ {
@@ -284,7 +279,7 @@ namespace v2rayN.Forms
private void btnClose_Click(object sender, EventArgs e) private void btnClose_Click(object sender, EventArgs e)
{ {
this.DialogResult = DialogResult.Cancel; DialogResult = DialogResult.Cancel;
} }
} }
} }

View File

@@ -143,10 +143,613 @@
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve"> <data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<data name="&gt;&gt;label17.Name" xml:space="preserve">
<value>label17</value>
</data>
<data name="&gt;&gt;label17.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label17.Parent" xml:space="preserve">
<value>panSocks</value>
</data>
<data name="&gt;&gt;label17.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;txtSecurity4.Name" xml:space="preserve">
<value>txtSecurity4</value>
</data>
<data name="&gt;&gt;txtSecurity4.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtSecurity4.Parent" xml:space="preserve">
<value>panSocks</value>
</data>
<data name="&gt;&gt;txtSecurity4.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;label18.Name" xml:space="preserve">
<value>label18</value>
</data>
<data name="&gt;&gt;label18.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label18.Parent" xml:space="preserve">
<value>panSocks</value>
</data>
<data name="&gt;&gt;label18.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;txtId4.Name" xml:space="preserve">
<value>txtId4</value>
</data>
<data name="&gt;&gt;txtId4.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtId4.Parent" xml:space="preserve">
<value>panSocks</value>
</data>
<data name="&gt;&gt;txtId4.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="panSocks.Location" type="System.Drawing.Point, System.Drawing">
<value>303, 163</value>
</data>
<data name="panSocks.Size" type="System.Drawing.Size, System.Drawing">
<value>82, 39</value>
</data>
<data name="panSocks.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
</data>
<data name="panSocks.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;panSocks.Name" xml:space="preserve">
<value>panSocks</value>
</data>
<data name="&gt;&gt;panSocks.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panSocks.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panSocks.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;txtId3.Name" xml:space="preserve">
<value>txtId3</value>
</data>
<data name="&gt;&gt;txtId3.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtId3.Parent" xml:space="preserve">
<value>panSs</value>
</data>
<data name="&gt;&gt;txtId3.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;label15.Name" xml:space="preserve">
<value>label15</value>
</data>
<data name="&gt;&gt;label15.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label15.Parent" xml:space="preserve">
<value>panSs</value>
</data>
<data name="&gt;&gt;label15.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;cmbSecurity3.Name" xml:space="preserve">
<value>cmbSecurity3</value>
</data>
<data name="&gt;&gt;cmbSecurity3.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmbSecurity3.Parent" xml:space="preserve">
<value>panSs</value>
</data>
<data name="&gt;&gt;cmbSecurity3.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;label16.Name" xml:space="preserve">
<value>label16</value>
</data>
<data name="&gt;&gt;label16.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label16.Parent" xml:space="preserve">
<value>panSs</value>
</data>
<data name="&gt;&gt;label16.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="panSs.Location" type="System.Drawing.Point, System.Drawing">
<value>142, 163</value>
</data>
<data name="panSs.Size" type="System.Drawing.Size, System.Drawing">
<value>82, 39</value>
</data>
<data name="panSs.TabIndex" type="System.Int32, mscorlib">
<value>30</value>
</data>
<data name="panSs.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;panSs.Name" xml:space="preserve">
<value>panSs</value>
</data>
<data name="&gt;&gt;panSs.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panSs.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panSs.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;label12.Name" xml:space="preserve">
<value>label12</value>
</data>
<data name="&gt;&gt;label12.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label12.Parent" xml:space="preserve">
<value>panTrojan</value>
</data>
<data name="&gt;&gt;label12.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;cmbFlow6.Name" xml:space="preserve">
<value>cmbFlow6</value>
</data>
<data name="&gt;&gt;cmbFlow6.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmbFlow6.Parent" xml:space="preserve">
<value>panTrojan</value>
</data>
<data name="&gt;&gt;cmbFlow6.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;txtId6.Name" xml:space="preserve">
<value>txtId6</value>
</data>
<data name="&gt;&gt;txtId6.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtId6.Parent" xml:space="preserve">
<value>panTrojan</value>
</data>
<data name="&gt;&gt;txtId6.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;label14.Name" xml:space="preserve">
<value>label14</value>
</data>
<data name="&gt;&gt;label14.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label14.Parent" xml:space="preserve">
<value>panTrojan</value>
</data>
<data name="&gt;&gt;label14.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="panTrojan.Location" type="System.Drawing.Point, System.Drawing">
<value>534, 163</value>
</data>
<data name="panTrojan.Size" type="System.Drawing.Size, System.Drawing">
<value>82, 39</value>
</data>
<data name="panTrojan.TabIndex" type="System.Int32, mscorlib">
<value>29</value>
</data>
<data name="panTrojan.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;panTrojan.Name" xml:space="preserve">
<value>panTrojan</value>
</data>
<data name="&gt;&gt;panTrojan.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panTrojan.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panTrojan.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;label7.Name" xml:space="preserve">
<value>label7</value>
</data>
<data name="&gt;&gt;label7.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label7.Parent" xml:space="preserve">
<value>panVless</value>
</data>
<data name="&gt;&gt;label7.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;cmbFlow5.Name" xml:space="preserve">
<value>cmbFlow5</value>
</data>
<data name="&gt;&gt;cmbFlow5.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmbFlow5.Parent" xml:space="preserve">
<value>panVless</value>
</data>
<data name="&gt;&gt;cmbFlow5.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;txtId5.Name" xml:space="preserve">
<value>txtId5</value>
</data>
<data name="&gt;&gt;txtId5.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtId5.Parent" xml:space="preserve">
<value>panVless</value>
</data>
<data name="&gt;&gt;txtId5.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;label9.Name" xml:space="preserve">
<value>label9</value>
</data>
<data name="&gt;&gt;label9.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label9.Parent" xml:space="preserve">
<value>panVless</value>
</data>
<data name="&gt;&gt;label9.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="&gt;&gt;label10.Name" xml:space="preserve">
<value>label10</value>
</data>
<data name="&gt;&gt;label10.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label10.Parent" xml:space="preserve">
<value>panVless</value>
</data>
<data name="&gt;&gt;label10.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="&gt;&gt;btnGUID5.Name" xml:space="preserve">
<value>btnGUID5</value>
</data>
<data name="&gt;&gt;btnGUID5.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnGUID5.Parent" xml:space="preserve">
<value>panVless</value>
</data>
<data name="&gt;&gt;btnGUID5.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="&gt;&gt;cmbSecurity5.Name" xml:space="preserve">
<value>cmbSecurity5</value>
</data>
<data name="&gt;&gt;cmbSecurity5.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmbSecurity5.Parent" xml:space="preserve">
<value>panVless</value>
</data>
<data name="&gt;&gt;cmbSecurity5.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="&gt;&gt;label11.Name" xml:space="preserve">
<value>label11</value>
</data>
<data name="&gt;&gt;label11.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label11.Parent" xml:space="preserve">
<value>panVless</value>
</data>
<data name="&gt;&gt;label11.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="panVless.Location" type="System.Drawing.Point, System.Drawing">
<value>396, 166</value>
</data>
<data name="panVless.Size" type="System.Drawing.Size, System.Drawing">
<value>92, 36</value>
</data>
<data name="panVless.TabIndex" type="System.Int32, mscorlib">
<value>27</value>
</data>
<data name="panVless.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;panVless.Name" xml:space="preserve">
<value>panVless</value>
</data>
<data name="&gt;&gt;panVless.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panVless.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panVless.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>panVmess</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;txtId.Name" xml:space="preserve">
<value>txtId</value>
</data>
<data name="&gt;&gt;txtId.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtId.Parent" xml:space="preserve">
<value>panVmess</value>
</data>
<data name="&gt;&gt;txtId.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;btnGUID.Name" xml:space="preserve">
<value>btnGUID</value>
</data>
<data name="&gt;&gt;btnGUID.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnGUID.Parent" xml:space="preserve">
<value>panVmess</value>
</data>
<data name="&gt;&gt;btnGUID.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;label4.Name" xml:space="preserve">
<value>label4</value>
</data>
<data name="&gt;&gt;label4.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label4.Parent" xml:space="preserve">
<value>panVmess</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="&gt;&gt;label8.Name" xml:space="preserve">
<value>label8</value>
</data>
<data name="&gt;&gt;label8.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label8.Parent" xml:space="preserve">
<value>panVmess</value>
</data>
<data name="&gt;&gt;label8.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="&gt;&gt;txtAlterId.Name" xml:space="preserve">
<value>txtAlterId</value>
</data>
<data name="&gt;&gt;txtAlterId.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtAlterId.Parent" xml:space="preserve">
<value>panVmess</value>
</data>
<data name="&gt;&gt;txtAlterId.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="&gt;&gt;cmbSecurity.Name" xml:space="preserve">
<value>cmbSecurity</value>
</data>
<data name="&gt;&gt;cmbSecurity.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmbSecurity.Parent" xml:space="preserve">
<value>panVmess</value>
</data>
<data name="&gt;&gt;cmbSecurity.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="&gt;&gt;label5.Name" xml:space="preserve">
<value>label5</value>
</data>
<data name="&gt;&gt;label5.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label5.Parent" xml:space="preserve">
<value>panVmess</value>
</data>
<data name="&gt;&gt;label5.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="panVmess.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 163</value>
</data>
<data name="panVmess.Size" type="System.Drawing.Size, System.Drawing">
<value>82, 39</value>
</data>
<data name="panVmess.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="panVmess.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;panVmess.Name" xml:space="preserve">
<value>panVmess</value>
</data>
<data name="&gt;&gt;panVmess.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panVmess.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panVmess.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="&gt;&gt;cmbCoreType.Name" xml:space="preserve">
<value>cmbCoreType</value>
</data>
<data name="&gt;&gt;cmbCoreType.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmbCoreType.Parent" xml:space="preserve">
<value>panAddr</value>
</data>
<data name="&gt;&gt;cmbCoreType.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;labCoreType.Name" xml:space="preserve">
<value>labCoreType</value>
</data>
<data name="&gt;&gt;labCoreType.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labCoreType.Parent" xml:space="preserve">
<value>panAddr</value>
</data>
<data name="&gt;&gt;labCoreType.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;label6.Name" xml:space="preserve">
<value>label6</value>
</data>
<data name="&gt;&gt;label6.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label6.Parent" xml:space="preserve">
<value>panAddr</value>
</data>
<data name="&gt;&gt;label6.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>panAddr</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="&gt;&gt;txtAddress.Name" xml:space="preserve">
<value>txtAddress</value>
</data>
<data name="&gt;&gt;txtAddress.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtAddress.Parent" xml:space="preserve">
<value>panAddr</value>
</data>
<data name="&gt;&gt;txtAddress.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>panAddr</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="&gt;&gt;txtPort.Name" xml:space="preserve">
<value>txtPort</value>
</data>
<data name="&gt;&gt;txtPort.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtPort.Parent" xml:space="preserve">
<value>panAddr</value>
</data>
<data name="&gt;&gt;txtPort.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>panAddr</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="panAddr.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="panAddr.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="panAddr.Size" type="System.Drawing.Size, System.Drawing">
<value>723, 100</value>
</data>
<data name="panAddr.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="&gt;&gt;panAddr.Name" xml:space="preserve">
<value>panAddr</value>
</data>
<data name="&gt;&gt;panAddr.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panAddr.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panAddr.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 10</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>729, 226</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Server</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label17.AutoSize" type="System.Boolean, mscorlib"> <data name="label17.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="label17.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="label17.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
@@ -246,30 +849,6 @@
<data name="&gt;&gt;txtId4.ZOrder" xml:space="preserve"> <data name="&gt;&gt;txtId4.ZOrder" xml:space="preserve">
<value>3</value> <value>3</value>
</data> </data>
<data name="panSocks.Location" type="System.Drawing.Point, System.Drawing">
<value>303, 163</value>
</data>
<data name="panSocks.Size" type="System.Drawing.Size, System.Drawing">
<value>82, 39</value>
</data>
<data name="panSocks.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
</data>
<data name="panSocks.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;panSocks.Name" xml:space="preserve">
<value>panSocks</value>
</data>
<data name="&gt;&gt;panSocks.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panSocks.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panSocks.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="txtId3.Location" type="System.Drawing.Point, System.Drawing"> <data name="txtId3.Location" type="System.Drawing.Point, System.Drawing">
<value>126, 7</value> <value>126, 7</value>
</data> </data>
@@ -372,30 +951,6 @@
<data name="&gt;&gt;label16.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label16.ZOrder" xml:space="preserve">
<value>3</value> <value>3</value>
</data> </data>
<data name="panSs.Location" type="System.Drawing.Point, System.Drawing">
<value>142, 163</value>
</data>
<data name="panSs.Size" type="System.Drawing.Size, System.Drawing">
<value>82, 39</value>
</data>
<data name="panSs.TabIndex" type="System.Int32, mscorlib">
<value>30</value>
</data>
<data name="panSs.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;panSs.Name" xml:space="preserve">
<value>panSs</value>
</data>
<data name="&gt;&gt;panSs.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panSs.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panSs.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label12.AutoSize" type="System.Boolean, mscorlib"> <data name="label12.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
@@ -498,30 +1053,6 @@
<data name="&gt;&gt;label14.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label14.ZOrder" xml:space="preserve">
<value>3</value> <value>3</value>
</data> </data>
<data name="panTrojan.Location" type="System.Drawing.Point, System.Drawing">
<value>534, 163</value>
</data>
<data name="panTrojan.Size" type="System.Drawing.Size, System.Drawing">
<value>82, 39</value>
</data>
<data name="panTrojan.TabIndex" type="System.Int32, mscorlib">
<value>29</value>
</data>
<data name="panTrojan.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;panTrojan.Name" xml:space="preserve">
<value>panTrojan</value>
</data>
<data name="&gt;&gt;panTrojan.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panTrojan.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panTrojan.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="label7.AutoSize" type="System.Boolean, mscorlib"> <data name="label7.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
@@ -735,30 +1266,6 @@
<data name="&gt;&gt;label11.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label11.ZOrder" xml:space="preserve">
<value>7</value> <value>7</value>
</data> </data>
<data name="panVless.Location" type="System.Drawing.Point, System.Drawing">
<value>396, 166</value>
</data>
<data name="panVless.Size" type="System.Drawing.Size, System.Drawing">
<value>92, 36</value>
</data>
<data name="panVless.TabIndex" type="System.Int32, mscorlib">
<value>27</value>
</data>
<data name="panVless.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;panVless.Name" xml:space="preserve">
<value>panVless</value>
</data>
<data name="&gt;&gt;panVless.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panVless.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panVless.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib"> <data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
@@ -954,30 +1461,6 @@
<data name="&gt;&gt;label5.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label5.ZOrder" xml:space="preserve">
<value>7</value> <value>7</value>
</data> </data>
<data name="panVmess.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 163</value>
</data>
<data name="panVmess.Size" type="System.Drawing.Size, System.Drawing">
<value>82, 39</value>
</data>
<data name="panVmess.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="panVmess.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;panVmess.Name" xml:space="preserve">
<value>panVmess</value>
</data>
<data name="&gt;&gt;panVmess.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panVmess.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panVmess.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="cmbCoreType.Location" type="System.Drawing.Point, System.Drawing"> <data name="cmbCoreType.Location" type="System.Drawing.Point, System.Drawing">
<value>625, 8</value> <value>625, 8</value>
</data> </data>
@@ -1173,56 +1656,41 @@
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve"> <data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>7</value> <value>7</value>
</data> </data>
<data name="panAddr.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>Top</value> <value>btnOK</value>
</data> </data>
<data name="panAddr.Location" type="System.Drawing.Point, System.Drawing"> <data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>3, 17</value> <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="panAddr.Size" type="System.Drawing.Size, System.Drawing"> <data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>723, 100</value> <value>panBottom</value>
</data> </data>
<data name="panAddr.TabIndex" type="System.Int32, mscorlib"> <data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>24</value> <value>1</value>
</data> </data>
<data name="&gt;&gt;panAddr.Name" xml:space="preserve"> <data name="panBottom.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>panAddr</value> <value>Bottom</value>
</data> </data>
<data name="&gt;&gt;panAddr.Type" xml:space="preserve"> <data name="panBottom.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 501</value>
</data>
<data name="panBottom.Size" type="System.Drawing.Size, System.Drawing">
<value>729, 60</value>
</data>
<data name="panBottom.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;panBottom.Name" xml:space="preserve">
<value>panBottom</value>
</data>
<data name="&gt;&gt;panBottom.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;panAddr.Parent" xml:space="preserve"> <data name="&gt;&gt;panBottom.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panAddr.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 10</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>729, 221</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Server</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve"> <data name="&gt;&gt;panBottom.ZOrder" xml:space="preserve">
<value>0</value> <value>2</value>
</data> </data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing"> <data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>303, 17</value> <value>303, 17</value>
@@ -1248,30 +1716,6 @@
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve"> <data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value> <value>1</value>
</data> </data>
<data name="panBottom.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="panBottom.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 461</value>
</data>
<data name="panBottom.Size" type="System.Drawing.Size, System.Drawing">
<value>729, 60</value>
</data>
<data name="panBottom.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;panBottom.Name" xml:space="preserve">
<value>panBottom</value>
</data>
<data name="&gt;&gt;panBottom.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panBottom.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panBottom.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="panTop.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="panTop.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value> <value>Top</value>
</data> </data>
@@ -1303,7 +1747,7 @@
<value>0, 0</value> <value>0, 0</value>
</data> </data>
<data name="transportControl.Size" type="System.Drawing.Size, System.Drawing"> <data name="transportControl.Size" type="System.Drawing.Size, System.Drawing">
<value>729, 230</value> <value>729, 265</value>
</data> </data>
<data name="transportControl.TabIndex" type="System.Int32, mscorlib"> <data name="transportControl.TabIndex" type="System.Int32, mscorlib">
<value>0</value> <value>0</value>
@@ -1312,7 +1756,7 @@
<value>transportControl</value> <value>transportControl</value>
</data> </data>
<data name="&gt;&gt;transportControl.Type" xml:space="preserve"> <data name="&gt;&gt;transportControl.Type" xml:space="preserve">
<value>v2rayN.Forms.ServerTransportControl, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value> <value>v2rayN.Forms.ServerTransportControl, v2rayN, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;transportControl.Parent" xml:space="preserve"> <data name="&gt;&gt;transportControl.Parent" xml:space="preserve">
<value>panTran</value> <value>panTran</value>
@@ -1324,10 +1768,10 @@
<value>Bottom</value> <value>Bottom</value>
</data> </data>
<data name="panTran.Location" type="System.Drawing.Point, System.Drawing"> <data name="panTran.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 231</value> <value>0, 236</value>
</data> </data>
<data name="panTran.Size" type="System.Drawing.Size, System.Drawing"> <data name="panTran.Size" type="System.Drawing.Size, System.Drawing">
<value>729, 230</value> <value>729, 265</value>
</data> </data>
<data name="panTran.TabIndex" type="System.Int32, mscorlib"> <data name="panTran.TabIndex" type="System.Int32, mscorlib">
<value>9</value> <value>9</value>
@@ -1354,7 +1798,7 @@
<value>6, 12</value> <value>6, 12</value>
</data> </data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing"> <data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>729, 521</value> <value>729, 561</value>
</data> </data>
<data name="$this.Text" xml:space="preserve"> <data name="$this.Text" xml:space="preserve">
<value>Edit or add a [VMess] server</value> <value>Edit or add a [VMess] server</value>
@@ -1363,6 +1807,6 @@
<value>AddServerForm</value> <value>AddServerForm</value>
</data> </data>
<data name="&gt;&gt;$this.Type" xml:space="preserve"> <data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseServerForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value> <value>v2rayN.Forms.BaseServerForm, v2rayN, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
</root> </root>

View File

@@ -7,7 +7,6 @@ namespace v2rayN.Forms
public partial class BaseForm : Form public partial class BaseForm : Form
{ {
protected static Config config; protected static Config config;
protected static System.Drawing.Icon icon;
public BaseForm() public BaseForm()
{ {
@@ -19,16 +18,14 @@ namespace v2rayN.Forms
{ {
try try
{ {
if (icon == null) string file = Utils.GetPath(Global.CustomIconName);
if (System.IO.File.Exists(file))
{ {
string file = Utils.GetPath(Global.CustomIconName); Icon = new System.Drawing.Icon(file);
if (!System.IO.File.Exists(file)) return;
{
return;
}
icon = new System.Drawing.Icon(file);
} }
this.Icon = icon;
Icon = Properties.Resources.NotifyIcon1;
} }
catch (Exception e) catch (Exception e)
{ {

File diff suppressed because it is too large Load Diff

View File

@@ -101,7 +101,7 @@ namespace v2rayN.Forms
if (ConfigHandler.SaveConfig(ref config, false) == 0) if (ConfigHandler.SaveConfig(ref config, false) == 0)
{ {
this.DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }
else else
{ {
@@ -111,7 +111,7 @@ namespace v2rayN.Forms
private void btnClose_Click(object sender, EventArgs e) private void btnClose_Click(object sender, EventArgs e)
{ {
this.DialogResult = DialogResult.Cancel; DialogResult = DialogResult.Cancel;
} }
private void btnReset_Click(object sender, EventArgs e) private void btnReset_Click(object sender, EventArgs e)

View File

@@ -33,15 +33,20 @@
this.btnRemove = new System.Windows.Forms.Button(); this.btnRemove = new System.Windows.Forms.Button();
this.txtRemarks = new System.Windows.Forms.TextBox(); this.txtRemarks = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.numSort = new System.Windows.Forms.NumericUpDown();
this.label1 = new System.Windows.Forms.Label();
this.grbMain.SuspendLayout(); this.grbMain.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numSort)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// grbMain // grbMain
// //
resources.ApplyResources(this.grbMain, "grbMain"); this.grbMain.Controls.Add(this.label1);
this.grbMain.Controls.Add(this.numSort);
this.grbMain.Controls.Add(this.btnRemove); this.grbMain.Controls.Add(this.btnRemove);
this.grbMain.Controls.Add(this.txtRemarks); this.grbMain.Controls.Add(this.txtRemarks);
this.grbMain.Controls.Add(this.label2); this.grbMain.Controls.Add(this.label2);
resources.ApplyResources(this.grbMain, "grbMain");
this.grbMain.Name = "grbMain"; this.grbMain.Name = "grbMain";
this.grbMain.TabStop = false; this.grbMain.TabStop = false;
// //
@@ -63,6 +68,17 @@
resources.ApplyResources(this.label2, "label2"); resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2"; this.label2.Name = "label2";
// //
// numSort
//
resources.ApplyResources(this.numSort, "numSort");
this.numSort.Name = "numSort";
this.numSort.Leave += new System.EventHandler(this.txtRemarks_Leave);
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// GroupSettingControl // GroupSettingControl
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
@@ -72,6 +88,7 @@
this.Load += new System.EventHandler(this.GroupSettingControl_Load); this.Load += new System.EventHandler(this.GroupSettingControl_Load);
this.grbMain.ResumeLayout(false); this.grbMain.ResumeLayout(false);
this.grbMain.PerformLayout(); this.grbMain.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numSort)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@@ -82,5 +99,7 @@
private System.Windows.Forms.TextBox txtRemarks; private System.Windows.Forms.TextBox txtRemarks;
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnRemove; private System.Windows.Forms.Button btnRemove;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.NumericUpDown numSort;
} }
} }

View File

@@ -23,7 +23,7 @@ namespace v2rayN.Forms
private void GroupSettingControl_Load(object sender, EventArgs e) private void GroupSettingControl_Load(object sender, EventArgs e)
{ {
this.Height = grbMain.Height; Height = grbMain.Height;
BindingSub(); BindingSub();
} }
@@ -32,6 +32,7 @@ namespace v2rayN.Forms
if (groupItem != null) if (groupItem != null)
{ {
txtRemarks.Text = groupItem.remarks.ToString(); txtRemarks.Text = groupItem.remarks.ToString();
numSort.Value = groupItem.sort;
} }
} }
private void EndBindingSub() private void EndBindingSub()
@@ -39,6 +40,7 @@ namespace v2rayN.Forms
if (groupItem != null) if (groupItem != null)
{ {
groupItem.remarks = txtRemarks.Text.TrimEx(); groupItem.remarks = txtRemarks.Text.TrimEx();
groupItem.sort = Convert.ToInt32(numSort.Value);
} }
} }
private void txtRemarks_Leave(object sender, EventArgs e) private void txtRemarks_Leave(object sender, EventArgs e)

View File

@@ -118,126 +118,177 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="grbMain.TabIndex" type="System.Int32, mscorlib"> <data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>10</value> <value>True</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="label1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data> </data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing"> <data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 12</value> <value>12, 61</value>
</data> </data>
<data name="&gt;&gt;grbMain.ZOrder" xml:space="preserve"> <data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>26</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Sort number</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing"> <data name="numSort.Location" type="System.Drawing.Point, System.Drawing">
<value>292, 21</value> <value>127, 57</value>
</data>
<data name="numSort.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 21</value>
</data>
<data name="numSort.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="&gt;&gt;numSort.Name" xml:space="preserve">
<value>numSort</value>
</data>
<data name="&gt;&gt;numSort.Type" xml:space="preserve">
<value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;numSort.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;numSort.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="btnRemove.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data> </data>
<data name="btnRemove.Location" type="System.Drawing.Point, System.Drawing"> <data name="btnRemove.Location" type="System.Drawing.Point, System.Drawing">
<value>525, 21</value> <value>525, 21</value>
</data> </data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing"> <data name="btnRemove.Size" type="System.Drawing.Size, System.Drawing">
<value>127, 21</value> <value>75, 23</value>
</data>
<data name="&gt;&gt;btnRemove.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 25</value>
</data> </data>
<data name="btnRemove.TabIndex" type="System.Int32, mscorlib"> <data name="btnRemove.TabIndex" type="System.Int32, mscorlib">
<value>24</value> <value>24</value>
</data> </data>
<data name="&gt;&gt;$this.Type" xml:space="preserve"> <data name="btnRemove.Text" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>Remove</value>
</data> </data>
<data name="&gt;&gt;$this.Name" xml:space="preserve"> <data name="&gt;&gt;btnRemove.Name" xml:space="preserve">
<value>GroupSettingControl</value> <value>btnRemove</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>grbMain</value>
</data> </data>
<data name="&gt;&gt;btnRemove.Type" xml:space="preserve"> <data name="&gt;&gt;btnRemove.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;grbMain.Name" xml:space="preserve"> <data name="&gt;&gt;btnRemove.Parent" xml:space="preserve">
<value>grbMain</value> <value>grbMain</value>
</data> </data>
<data name="&gt;&gt;label2.Type" xml:space="preserve"> <data name="&gt;&gt;btnRemove.ZOrder" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>2</value> <value>2</value>
</data> </data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 21</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>292, 21</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 25</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Remarks</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve"> <data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value> <value>label2</value>
</data> </data>
<data name="btnRemove.Size" type="System.Drawing.Size, System.Drawing"> <data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>75, 23</value> <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="grbMain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data> </data>
<data name="grbMain.Location" type="System.Drawing.Point, System.Drawing"> <data name="grbMain.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value> <value>0, 0</value>
</data> </data>
<data name="grbMain.Size" type="System.Drawing.Size, System.Drawing"> <data name="grbMain.Size" type="System.Drawing.Size, System.Drawing">
<value>619, 61</value> <value>619, 91</value>
</data> </data>
<data name="label2.Text" xml:space="preserve"> <data name="grbMain.TabIndex" type="System.Int32, mscorlib">
<value>Remarks</value> <value>10</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>grbMain</value>
</data> </data>
<data name="grbMain.Text" xml:space="preserve"> <data name="grbMain.Text" xml:space="preserve">
<value>Group details</value> <value>Group details</value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <data name="&gt;&gt;grbMain.Name" xml:space="preserve">
<data name="label2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <value>grbMain</value>
<value>NoControl</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="&gt;&gt;btnRemove.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnRemove.Name" xml:space="preserve">
<value>btnRemove</value>
</data>
<data name="grbMain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="btnRemove.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data> </data>
<data name="&gt;&gt;grbMain.Type" xml:space="preserve"> <data name="&gt;&gt;grbMain.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;grbMain.Parent" xml:space="preserve"> <data name="&gt;&gt;grbMain.Parent" xml:space="preserve">
<value>$this</value> <value>$this</value>
</data> </data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing"> <data name="&gt;&gt;grbMain.ZOrder" xml:space="preserve">
<value>619, 61</value> <value>0</value>
</data>
<data name="btnRemove.Text" xml:space="preserve">
<value>Remove</value>
</data> </data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>619, 91</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>GroupSettingControl</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root> </root>

View File

@@ -130,4 +130,7 @@
<data name="grbMain.Text" xml:space="preserve"> <data name="grbMain.Text" xml:space="preserve">
<value>分组详情</value> <value>分组详情</value>
</data> </data>
<data name="label1.Text" xml:space="preserve">
<value>排序编号</value>
</data>
</root> </root>

View File

@@ -70,7 +70,7 @@ namespace v2rayN.Forms
{ {
if (ConfigHandler.SaveGroupItem(ref config) == 0) if (ConfigHandler.SaveGroupItem(ref config) == 0)
{ {
this.DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }
else else
{ {
@@ -80,7 +80,7 @@ namespace v2rayN.Forms
private void btnClose_Click(object sender, EventArgs e) private void btnClose_Click(object sender, EventArgs e)
{ {
this.DialogResult = DialogResult.Cancel; DialogResult = DialogResult.Cancel;
} }
private void btnAdd_Click(object sender, EventArgs e) private void btnAdd_Click(object sender, EventArgs e)

View File

@@ -30,7 +30,7 @@
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.scMain = new System.Windows.Forms.SplitContainer(); this.scServers = new System.Windows.Forms.SplitContainer();
this.lvServers = new v2rayN.Base.ListViewFlickerFree(); this.lvServers = new v2rayN.Base.ListViewFlickerFree();
this.cmsLv = new System.Windows.Forms.ContextMenuStrip(this.components); this.cmsLv = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuAddVmessServer = new System.Windows.Forms.ToolStripMenuItem(); this.menuAddVmessServer = new System.Windows.Forms.ToolStripMenuItem();
@@ -42,12 +42,14 @@
this.menuAddServers = new System.Windows.Forms.ToolStripMenuItem(); this.menuAddServers = new System.Windows.Forms.ToolStripMenuItem();
this.menuScanScreen = new System.Windows.Forms.ToolStripMenuItem(); this.menuScanScreen = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.menuServerFilter = new System.Windows.Forms.ToolStripMenuItem();
this.menuRemoveServer = new System.Windows.Forms.ToolStripMenuItem(); this.menuRemoveServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuRemoveDuplicateServer = new System.Windows.Forms.ToolStripMenuItem(); this.menuRemoveDuplicateServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuCopyServer = new System.Windows.Forms.ToolStripMenuItem(); this.menuCopyServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuSetDefaultServer = new System.Windows.Forms.ToolStripMenuItem(); this.menuSetDefaultServer = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.menuMoveToGroup = new System.Windows.Forms.ToolStripMenuItem(); this.menuMoveToGroup = new System.Windows.Forms.ToolStripMenuItem();
this.menuMoveEvent = new System.Windows.Forms.ToolStripMenuItem();
this.menuMoveTop = new System.Windows.Forms.ToolStripMenuItem(); this.menuMoveTop = new System.Windows.Forms.ToolStripMenuItem();
this.menuMoveUp = new System.Windows.Forms.ToolStripMenuItem(); this.menuMoveUp = new System.Windows.Forms.ToolStripMenuItem();
this.menuMoveDown = new System.Windows.Forms.ToolStripMenuItem(); this.menuMoveDown = new System.Windows.Forms.ToolStripMenuItem();
@@ -58,6 +60,7 @@
this.menuTcpingServer = new System.Windows.Forms.ToolStripMenuItem(); this.menuTcpingServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuRealPingServer = new System.Windows.Forms.ToolStripMenuItem(); this.menuRealPingServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuSpeedServer = new System.Windows.Forms.ToolStripMenuItem(); this.menuSpeedServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuSortServerResult = new System.Windows.Forms.ToolStripMenuItem();
this.tsbTestMe = new System.Windows.Forms.ToolStripMenuItem(); this.tsbTestMe = new System.Windows.Forms.ToolStripMenuItem();
this.menuClearServerStatistics = new System.Windows.Forms.ToolStripMenuItem(); this.menuClearServerStatistics = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
@@ -68,24 +71,9 @@
this.tsbServer = new System.Windows.Forms.ToolStripDropDownButton(); this.tsbServer = new System.Windows.Forms.ToolStripDropDownButton();
this.tabGroup = new System.Windows.Forms.TabControl(); this.tabGroup = new System.Windows.Forms.TabControl();
this.qrCodeControl = new v2rayN.Forms.QRCodeControl(); this.qrCodeControl = new v2rayN.Forms.QRCodeControl();
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.scBig = new System.Windows.Forms.SplitContainer();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.gbServers = new System.Windows.Forms.GroupBox();
this.gbMsgTitle = new System.Windows.Forms.GroupBox(); this.mainMsgControl = new v2rayN.Forms.MainMsgControl();
this.txtMsgBox = new System.Windows.Forms.TextBox();
this.cmsMsgBox = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuMsgBoxSelectAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxCopy = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxCopyAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxClear = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxAddRoutingRule = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxFilter = new System.Windows.Forms.ToolStripMenuItem();
this.ssMain = new System.Windows.Forms.StatusStrip();
this.toolSslInboundInfo = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank1 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslRoutingRule = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank2 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslServerSpeed = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank4 = new System.Windows.Forms.ToolStripStatusLabel();
this.notifyMain = new System.Windows.Forms.NotifyIcon(this.components); this.notifyMain = new System.Windows.Forms.NotifyIcon(this.components);
this.cmsMain = new System.Windows.Forms.ContextMenuStrip(this.components); this.cmsMain = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuSysAgentMode = new System.Windows.Forms.ToolStripMenuItem(); this.menuSysAgentMode = new System.Windows.Forms.ToolStripMenuItem();
@@ -94,7 +82,6 @@
this.menuKeepNothing = new System.Windows.Forms.ToolStripMenuItem(); this.menuKeepNothing = new System.Windows.Forms.ToolStripMenuItem();
this.menuRoutings = new System.Windows.Forms.ToolStripMenuItem(); this.menuRoutings = new System.Windows.Forms.ToolStripMenuItem();
this.menuServers = new System.Windows.Forms.ToolStripMenuItem(); this.menuServers = new System.Windows.Forms.ToolStripMenuItem();
this.menuServers2 = new System.Windows.Forms.ToolStripComboBox();
this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
this.menuAddServers2 = new System.Windows.Forms.ToolStripMenuItem(); this.menuAddServers2 = new System.Windows.Forms.ToolStripMenuItem();
this.menuScanScreen2 = new System.Windows.Forms.ToolStripMenuItem(); this.menuScanScreen2 = new System.Windows.Forms.ToolStripMenuItem();
@@ -109,6 +96,8 @@
this.tsbSubSetting = new System.Windows.Forms.ToolStripMenuItem(); this.tsbSubSetting = new System.Windows.Forms.ToolStripMenuItem();
this.tsbSubUpdate = new System.Windows.Forms.ToolStripMenuItem(); this.tsbSubUpdate = new System.Windows.Forms.ToolStripMenuItem();
this.tsbSubUpdateViaProxy = new System.Windows.Forms.ToolStripMenuItem(); this.tsbSubUpdateViaProxy = new System.Windows.Forms.ToolStripMenuItem();
this.tsbSubGroupUpdate = new System.Windows.Forms.ToolStripMenuItem();
this.tsbSubGroupUpdateViaProxy = new System.Windows.Forms.ToolStripMenuItem();
this.tsbQRCodeSwitch = new System.Windows.Forms.ToolStripButton(); this.tsbQRCodeSwitch = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.tsbSetting = new System.Windows.Forms.ToolStripDropDownButton(); this.tsbSetting = new System.Windows.Forms.ToolStripDropDownButton();
@@ -118,13 +107,18 @@
this.tsbGroupSetting = new System.Windows.Forms.ToolStripMenuItem(); this.tsbGroupSetting = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator();
this.tsbBackupGuiNConfig = new System.Windows.Forms.ToolStripMenuItem(); this.tsbBackupGuiNConfig = new System.Windows.Forms.ToolStripMenuItem();
this.tsbRestoreGuiNConfig = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.tsbReload = new System.Windows.Forms.ToolStripButton(); this.tsbReload = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.tsbCheckUpdate = new System.Windows.Forms.ToolStripDropDownButton(); this.tsbCheckUpdate = new System.Windows.Forms.ToolStripDropDownButton();
this.tsbCheckUpdateN = new System.Windows.Forms.ToolStripMenuItem(); this.tsbCheckUpdateN = new System.Windows.Forms.ToolStripMenuItem();
this.tsbCheckUpdateCore = new System.Windows.Forms.ToolStripMenuItem(); this.tsbCheckUpdateCore = new System.Windows.Forms.ToolStripMenuItem();
this.tsbCheckUpdateSagerNetCore = new System.Windows.Forms.ToolStripMenuItem();
this.tsbCheckUpdateXrayCore = new System.Windows.Forms.ToolStripMenuItem(); this.tsbCheckUpdateXrayCore = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator16 = new System.Windows.Forms.ToolStripSeparator();
this.tsbCheckUpdateClashCore = new System.Windows.Forms.ToolStripMenuItem();
this.tsbCheckUpdateClashMetaCore = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator();
this.tsbCheckUpdateGeo = new System.Windows.Forms.ToolStripMenuItem(); this.tsbCheckUpdateGeo = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
@@ -137,38 +131,35 @@
this.tsbPromotion = new System.Windows.Forms.ToolStripButton(); this.tsbPromotion = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
this.tsbClose = new System.Windows.Forms.ToolStripButton(); this.tsbClose = new System.Windows.Forms.ToolStripButton();
((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.scServers)).BeginInit();
this.scMain.Panel1.SuspendLayout(); this.scServers.Panel1.SuspendLayout();
this.scMain.Panel2.SuspendLayout(); this.scServers.Panel2.SuspendLayout();
this.scMain.SuspendLayout(); this.scServers.SuspendLayout();
this.cmsLv.SuspendLayout(); this.cmsLv.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.scBig)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.scBig.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.scBig.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout(); this.scBig.SuspendLayout();
this.groupBox1.SuspendLayout(); this.gbServers.SuspendLayout();
this.gbMsgTitle.SuspendLayout();
this.cmsMsgBox.SuspendLayout();
this.ssMain.SuspendLayout();
this.cmsMain.SuspendLayout(); this.cmsMain.SuspendLayout();
this.tsMain.SuspendLayout(); this.tsMain.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// scMain // scServers
// //
resources.ApplyResources(this.scMain, "scMain"); resources.ApplyResources(this.scServers, "scServers");
this.scMain.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; this.scServers.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.scMain.Name = "scMain"; this.scServers.Name = "scServers";
// //
// scMain.Panel1 // scServers.Panel1
// //
this.scMain.Panel1.Controls.Add(this.lvServers); this.scServers.Panel1.Controls.Add(this.lvServers);
this.scMain.Panel1.Controls.Add(this.tabGroup); this.scServers.Panel1.Controls.Add(this.tabGroup);
// //
// scMain.Panel2 // scServers.Panel2
// //
this.scMain.Panel2.Controls.Add(this.qrCodeControl); this.scServers.Panel2.Controls.Add(this.qrCodeControl);
this.scMain.TabStop = false; this.scServers.TabStop = false;
// //
// lvServers // lvServers
// //
@@ -203,22 +194,21 @@
this.menuAddServers, this.menuAddServers,
this.menuScanScreen, this.menuScanScreen,
this.toolStripSeparator1, this.toolStripSeparator1,
this.menuServerFilter,
this.menuRemoveServer, this.menuRemoveServer,
this.menuRemoveDuplicateServer, this.menuRemoveDuplicateServer,
this.menuCopyServer, this.menuCopyServer,
this.menuSetDefaultServer, this.menuSetDefaultServer,
this.toolStripSeparator3, this.toolStripSeparator3,
this.menuMoveToGroup, this.menuMoveToGroup,
this.menuMoveTop, this.menuMoveEvent,
this.menuMoveUp,
this.menuMoveDown,
this.menuMoveBottom,
this.menuSelectAll, this.menuSelectAll,
this.toolStripSeparator9, this.toolStripSeparator9,
this.menuPingServer, this.menuPingServer,
this.menuTcpingServer, this.menuTcpingServer,
this.menuRealPingServer, this.menuRealPingServer,
this.menuSpeedServer, this.menuSpeedServer,
this.menuSortServerResult,
this.tsbTestMe, this.tsbTestMe,
this.menuClearServerStatistics, this.menuClearServerStatistics,
this.toolStripSeparator6, this.toolStripSeparator6,
@@ -283,6 +273,12 @@
this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Name = "toolStripSeparator1";
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1"); resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
// //
// menuServerFilter
//
this.menuServerFilter.Name = "menuServerFilter";
resources.ApplyResources(this.menuServerFilter, "menuServerFilter");
this.menuServerFilter.Click += new System.EventHandler(this.menuServerFilter_Click);
//
// menuRemoveServer // menuRemoveServer
// //
this.menuRemoveServer.Name = "menuRemoveServer"; this.menuRemoveServer.Name = "menuRemoveServer";
@@ -318,6 +314,16 @@
resources.ApplyResources(this.menuMoveToGroup, "menuMoveToGroup"); resources.ApplyResources(this.menuMoveToGroup, "menuMoveToGroup");
this.menuMoveToGroup.Click += new System.EventHandler(this.menuMoveToGroup_Click); this.menuMoveToGroup.Click += new System.EventHandler(this.menuMoveToGroup_Click);
// //
// menuMoveEvent
//
this.menuMoveEvent.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuMoveTop,
this.menuMoveUp,
this.menuMoveDown,
this.menuMoveBottom});
this.menuMoveEvent.Name = "menuMoveEvent";
resources.ApplyResources(this.menuMoveEvent, "menuMoveEvent");
//
// menuMoveTop // menuMoveTop
// //
this.menuMoveTop.Name = "menuMoveTop"; this.menuMoveTop.Name = "menuMoveTop";
@@ -377,6 +383,12 @@
resources.ApplyResources(this.menuSpeedServer, "menuSpeedServer"); resources.ApplyResources(this.menuSpeedServer, "menuSpeedServer");
this.menuSpeedServer.Click += new System.EventHandler(this.menuSpeedServer_Click); this.menuSpeedServer.Click += new System.EventHandler(this.menuSpeedServer_Click);
// //
// menuSortServerResult
//
this.menuSortServerResult.Name = "menuSortServerResult";
resources.ApplyResources(this.menuSortServerResult, "menuSortServerResult");
this.menuSortServerResult.Click += new System.EventHandler(this.menuSortServerResult_Click);
//
// tsbTestMe // tsbTestMe
// //
this.tsbTestMe.Name = "tsbTestMe"; this.tsbTestMe.Name = "tsbTestMe";
@@ -437,139 +449,30 @@
resources.ApplyResources(this.qrCodeControl, "qrCodeControl"); resources.ApplyResources(this.qrCodeControl, "qrCodeControl");
this.qrCodeControl.Name = "qrCodeControl"; this.qrCodeControl.Name = "qrCodeControl";
// //
// splitContainer1 // scBig
// //
resources.ApplyResources(this.splitContainer1, "splitContainer1"); resources.ApplyResources(this.scBig, "scBig");
this.splitContainer1.Name = "splitContainer1"; this.scBig.Name = "scBig";
// //
// splitContainer1.Panel1 // scBig.Panel1
// //
this.splitContainer1.Panel1.Controls.Add(this.groupBox1); this.scBig.Panel1.Controls.Add(this.gbServers);
// //
// splitContainer1.Panel2 // scBig.Panel2
// //
this.splitContainer1.Panel2.Controls.Add(this.gbMsgTitle); this.scBig.Panel2.Controls.Add(this.mainMsgControl);
// //
// groupBox1 // gbServers
// //
this.groupBox1.Controls.Add(this.scMain); this.gbServers.Controls.Add(this.scServers);
resources.ApplyResources(this.groupBox1, "groupBox1"); resources.ApplyResources(this.gbServers, "gbServers");
this.groupBox1.Name = "groupBox1"; this.gbServers.Name = "gbServers";
this.groupBox1.TabStop = false; this.gbServers.TabStop = false;
// //
// gbMsgTitle // mainMsgControl
// //
this.gbMsgTitle.Controls.Add(this.txtMsgBox); resources.ApplyResources(this.mainMsgControl, "mainMsgControl");
this.gbMsgTitle.Controls.Add(this.ssMain); this.mainMsgControl.Name = "mainMsgControl";
resources.ApplyResources(this.gbMsgTitle, "gbMsgTitle");
this.gbMsgTitle.Name = "gbMsgTitle";
this.gbMsgTitle.TabStop = false;
//
// txtMsgBox
//
this.txtMsgBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(49)))), ((int)(((byte)(52)))));
this.txtMsgBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtMsgBox.ContextMenuStrip = this.cmsMsgBox;
resources.ApplyResources(this.txtMsgBox, "txtMsgBox");
this.txtMsgBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(226)))), ((int)(((byte)(228)))));
this.txtMsgBox.Name = "txtMsgBox";
this.txtMsgBox.ReadOnly = true;
this.txtMsgBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtMsgBox_KeyDown);
//
// cmsMsgBox
//
this.cmsMsgBox.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuMsgBoxSelectAll,
this.menuMsgBoxCopy,
this.menuMsgBoxCopyAll,
this.menuMsgBoxClear,
this.menuMsgBoxAddRoutingRule,
this.menuMsgBoxFilter});
this.cmsMsgBox.Name = "cmsMsgBox";
resources.ApplyResources(this.cmsMsgBox, "cmsMsgBox");
//
// menuMsgBoxSelectAll
//
this.menuMsgBoxSelectAll.Name = "menuMsgBoxSelectAll";
resources.ApplyResources(this.menuMsgBoxSelectAll, "menuMsgBoxSelectAll");
this.menuMsgBoxSelectAll.Click += new System.EventHandler(this.menuMsgBoxSelectAll_Click);
//
// menuMsgBoxCopy
//
this.menuMsgBoxCopy.Name = "menuMsgBoxCopy";
resources.ApplyResources(this.menuMsgBoxCopy, "menuMsgBoxCopy");
this.menuMsgBoxCopy.Click += new System.EventHandler(this.menuMsgBoxCopy_Click);
//
// menuMsgBoxCopyAll
//
this.menuMsgBoxCopyAll.Name = "menuMsgBoxCopyAll";
resources.ApplyResources(this.menuMsgBoxCopyAll, "menuMsgBoxCopyAll");
this.menuMsgBoxCopyAll.Click += new System.EventHandler(this.menuMsgBoxCopyAll_Click);
//
// menuMsgBoxClear
//
this.menuMsgBoxClear.Name = "menuMsgBoxClear";
resources.ApplyResources(this.menuMsgBoxClear, "menuMsgBoxClear");
this.menuMsgBoxClear.Click += new System.EventHandler(this.menuMsgBoxClear_Click);
//
// menuMsgBoxAddRoutingRule
//
this.menuMsgBoxAddRoutingRule.Name = "menuMsgBoxAddRoutingRule";
resources.ApplyResources(this.menuMsgBoxAddRoutingRule, "menuMsgBoxAddRoutingRule");
this.menuMsgBoxAddRoutingRule.Click += new System.EventHandler(this.menuMsgBoxAddRoutingRule_Click);
//
// menuMsgBoxFilter
//
this.menuMsgBoxFilter.Name = "menuMsgBoxFilter";
resources.ApplyResources(this.menuMsgBoxFilter, "menuMsgBoxFilter");
this.menuMsgBoxFilter.Click += new System.EventHandler(this.menuMsgBoxFilter_Click);
//
// ssMain
//
this.ssMain.ImageScalingSize = new System.Drawing.Size(20, 20);
this.ssMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolSslInboundInfo,
this.toolSslBlank1,
this.toolSslRoutingRule,
this.toolSslBlank2,
this.toolSslServerSpeed,
this.toolSslBlank4});
resources.ApplyResources(this.ssMain, "ssMain");
this.ssMain.Name = "ssMain";
this.ssMain.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.ssMain_ItemClicked);
//
// toolSslInboundInfo
//
this.toolSslInboundInfo.Name = "toolSslInboundInfo";
resources.ApplyResources(this.toolSslInboundInfo, "toolSslInboundInfo");
//
// toolSslBlank1
//
resources.ApplyResources(this.toolSslBlank1, "toolSslBlank1");
this.toolSslBlank1.Name = "toolSslBlank1";
this.toolSslBlank1.Spring = true;
//
// toolSslRoutingRule
//
this.toolSslRoutingRule.Name = "toolSslRoutingRule";
resources.ApplyResources(this.toolSslRoutingRule, "toolSslRoutingRule");
//
// toolSslBlank2
//
this.toolSslBlank2.Name = "toolSslBlank2";
resources.ApplyResources(this.toolSslBlank2, "toolSslBlank2");
this.toolSslBlank2.Spring = true;
//
// toolSslServerSpeed
//
resources.ApplyResources(this.toolSslServerSpeed, "toolSslServerSpeed");
this.toolSslServerSpeed.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolSslServerSpeed.Name = "toolSslServerSpeed";
//
// toolSslBlank4
//
this.toolSslBlank4.Name = "toolSslBlank4";
resources.ApplyResources(this.toolSslBlank4, "toolSslBlank4");
// //
// notifyMain // notifyMain
// //
@@ -585,7 +488,6 @@
this.menuSysAgentMode, this.menuSysAgentMode,
this.menuRoutings, this.menuRoutings,
this.menuServers, this.menuServers,
this.menuServers2,
this.toolStripSeparator13, this.toolStripSeparator13,
this.menuAddServers2, this.menuAddServers2,
this.menuScanScreen2, this.menuScanScreen2,
@@ -635,14 +537,6 @@
this.menuServers.Name = "menuServers"; this.menuServers.Name = "menuServers";
resources.ApplyResources(this.menuServers, "menuServers"); resources.ApplyResources(this.menuServers, "menuServers");
// //
// menuServers2
//
this.menuServers2.BackColor = System.Drawing.SystemColors.Window;
this.menuServers2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.menuServers2.DropDownWidth = 500;
resources.ApplyResources(this.menuServers2, "menuServers2");
this.menuServers2.Name = "menuServers2";
//
// toolStripSeparator13 // toolStripSeparator13
// //
this.toolStripSeparator13.Name = "toolStripSeparator13"; this.toolStripSeparator13.Name = "toolStripSeparator13";
@@ -721,7 +615,9 @@
this.tsbSub.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tsbSub.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbSubSetting, this.tsbSubSetting,
this.tsbSubUpdate, this.tsbSubUpdate,
this.tsbSubUpdateViaProxy}); this.tsbSubUpdateViaProxy,
this.tsbSubGroupUpdate,
this.tsbSubGroupUpdateViaProxy});
this.tsbSub.Image = global::v2rayN.Properties.Resources.sub; this.tsbSub.Image = global::v2rayN.Properties.Resources.sub;
resources.ApplyResources(this.tsbSub, "tsbSub"); resources.ApplyResources(this.tsbSub, "tsbSub");
this.tsbSub.Name = "tsbSub"; this.tsbSub.Name = "tsbSub";
@@ -744,6 +640,18 @@
resources.ApplyResources(this.tsbSubUpdateViaProxy, "tsbSubUpdateViaProxy"); resources.ApplyResources(this.tsbSubUpdateViaProxy, "tsbSubUpdateViaProxy");
this.tsbSubUpdateViaProxy.Click += new System.EventHandler(this.tsbSubUpdateViaProxy_Click); this.tsbSubUpdateViaProxy.Click += new System.EventHandler(this.tsbSubUpdateViaProxy_Click);
// //
// tsbSubGroupUpdate
//
this.tsbSubGroupUpdate.Name = "tsbSubGroupUpdate";
resources.ApplyResources(this.tsbSubGroupUpdate, "tsbSubGroupUpdate");
this.tsbSubGroupUpdate.Click += new System.EventHandler(this.tsbSubGroupUpdate_Click);
//
// tsbSubGroupUpdateViaProxy
//
this.tsbSubGroupUpdateViaProxy.Name = "tsbSubGroupUpdateViaProxy";
resources.ApplyResources(this.tsbSubGroupUpdateViaProxy, "tsbSubGroupUpdateViaProxy");
this.tsbSubGroupUpdateViaProxy.Click += new System.EventHandler(this.tsbSubGroupUpdateViaProxy_Click);
//
// tsbQRCodeSwitch // tsbQRCodeSwitch
// //
this.tsbQRCodeSwitch.CheckOnClick = true; this.tsbQRCodeSwitch.CheckOnClick = true;
@@ -766,7 +674,8 @@
this.tsbGlobalHotkeySetting, this.tsbGlobalHotkeySetting,
this.tsbGroupSetting, this.tsbGroupSetting,
this.toolStripSeparator14, this.toolStripSeparator14,
this.tsbBackupGuiNConfig}); this.tsbBackupGuiNConfig,
this.tsbRestoreGuiNConfig});
this.tsbSetting.Image = global::v2rayN.Properties.Resources.option; this.tsbSetting.Image = global::v2rayN.Properties.Resources.option;
resources.ApplyResources(this.tsbSetting, "tsbSetting"); resources.ApplyResources(this.tsbSetting, "tsbSetting");
this.tsbSetting.Name = "tsbSetting"; this.tsbSetting.Name = "tsbSetting";
@@ -806,6 +715,12 @@
resources.ApplyResources(this.tsbBackupGuiNConfig, "tsbBackupGuiNConfig"); resources.ApplyResources(this.tsbBackupGuiNConfig, "tsbBackupGuiNConfig");
this.tsbBackupGuiNConfig.Click += new System.EventHandler(this.tsbBackupGuiNConfig_Click); this.tsbBackupGuiNConfig.Click += new System.EventHandler(this.tsbBackupGuiNConfig_Click);
// //
// tsbRestoreGuiNConfig
//
this.tsbRestoreGuiNConfig.Name = "tsbRestoreGuiNConfig";
resources.ApplyResources(this.tsbRestoreGuiNConfig, "tsbRestoreGuiNConfig");
this.tsbRestoreGuiNConfig.Click += new System.EventHandler(this.tsbRestoreGuiNConfig_Click);
//
// toolStripSeparator5 // toolStripSeparator5
// //
this.toolStripSeparator5.Name = "toolStripSeparator5"; this.toolStripSeparator5.Name = "toolStripSeparator5";
@@ -828,7 +743,11 @@
this.tsbCheckUpdate.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tsbCheckUpdate.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbCheckUpdateN, this.tsbCheckUpdateN,
this.tsbCheckUpdateCore, this.tsbCheckUpdateCore,
this.tsbCheckUpdateSagerNetCore,
this.tsbCheckUpdateXrayCore, this.tsbCheckUpdateXrayCore,
this.toolStripSeparator16,
this.tsbCheckUpdateClashCore,
this.tsbCheckUpdateClashMetaCore,
this.toolStripSeparator15, this.toolStripSeparator15,
this.tsbCheckUpdateGeo}); this.tsbCheckUpdateGeo});
this.tsbCheckUpdate.Image = global::v2rayN.Properties.Resources.checkupdate; this.tsbCheckUpdate.Image = global::v2rayN.Properties.Resources.checkupdate;
@@ -847,12 +766,35 @@
resources.ApplyResources(this.tsbCheckUpdateCore, "tsbCheckUpdateCore"); resources.ApplyResources(this.tsbCheckUpdateCore, "tsbCheckUpdateCore");
this.tsbCheckUpdateCore.Click += new System.EventHandler(this.tsbCheckUpdateCore_Click); this.tsbCheckUpdateCore.Click += new System.EventHandler(this.tsbCheckUpdateCore_Click);
// //
// tsbCheckUpdateSagerNetCore
//
this.tsbCheckUpdateSagerNetCore.Name = "tsbCheckUpdateSagerNetCore";
resources.ApplyResources(this.tsbCheckUpdateSagerNetCore, "tsbCheckUpdateSagerNetCore");
this.tsbCheckUpdateSagerNetCore.Click += new System.EventHandler(this.tsbCheckUpdateSagerNetCore_Click);
//
// tsbCheckUpdateXrayCore // tsbCheckUpdateXrayCore
// //
this.tsbCheckUpdateXrayCore.Name = "tsbCheckUpdateXrayCore"; this.tsbCheckUpdateXrayCore.Name = "tsbCheckUpdateXrayCore";
resources.ApplyResources(this.tsbCheckUpdateXrayCore, "tsbCheckUpdateXrayCore"); resources.ApplyResources(this.tsbCheckUpdateXrayCore, "tsbCheckUpdateXrayCore");
this.tsbCheckUpdateXrayCore.Click += new System.EventHandler(this.tsbCheckUpdateXrayCore_Click); this.tsbCheckUpdateXrayCore.Click += new System.EventHandler(this.tsbCheckUpdateXrayCore_Click);
// //
// toolStripSeparator16
//
this.toolStripSeparator16.Name = "toolStripSeparator16";
resources.ApplyResources(this.toolStripSeparator16, "toolStripSeparator16");
//
// tsbCheckUpdateClashCore
//
this.tsbCheckUpdateClashCore.Name = "tsbCheckUpdateClashCore";
resources.ApplyResources(this.tsbCheckUpdateClashCore, "tsbCheckUpdateClashCore");
this.tsbCheckUpdateClashCore.Click += new System.EventHandler(this.tsbCheckUpdateClashCore_Click);
//
// tsbCheckUpdateClashMetaCore
//
this.tsbCheckUpdateClashMetaCore.Name = "tsbCheckUpdateClashMetaCore";
resources.ApplyResources(this.tsbCheckUpdateClashMetaCore, "tsbCheckUpdateClashMetaCore");
this.tsbCheckUpdateClashMetaCore.Click += new System.EventHandler(this.tsbCheckUpdateClashMetaCore_Click);
//
// toolStripSeparator15 // toolStripSeparator15
// //
this.toolStripSeparator15.Name = "toolStripSeparator15"; this.toolStripSeparator15.Name = "toolStripSeparator15";
@@ -934,7 +876,7 @@
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.splitContainer1); this.Controls.Add(this.scBig);
this.Controls.Add(this.panel1); this.Controls.Add(this.panel1);
this.Controls.Add(this.tsMain); this.Controls.Add(this.tsMain);
this.MaximizeBox = true; this.MaximizeBox = true;
@@ -945,21 +887,16 @@
this.Shown += new System.EventHandler(this.MainForm_Shown); this.Shown += new System.EventHandler(this.MainForm_Shown);
this.VisibleChanged += new System.EventHandler(this.MainForm_VisibleChanged); this.VisibleChanged += new System.EventHandler(this.MainForm_VisibleChanged);
this.Resize += new System.EventHandler(this.MainForm_Resize); this.Resize += new System.EventHandler(this.MainForm_Resize);
this.scMain.Panel1.ResumeLayout(false); this.scServers.Panel1.ResumeLayout(false);
this.scMain.Panel2.ResumeLayout(false); this.scServers.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.scMain)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.scServers)).EndInit();
this.scMain.ResumeLayout(false); this.scServers.ResumeLayout(false);
this.cmsLv.ResumeLayout(false); this.cmsLv.ResumeLayout(false);
this.splitContainer1.Panel1.ResumeLayout(false); this.scBig.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false); this.scBig.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.scBig)).EndInit();
this.splitContainer1.ResumeLayout(false); this.scBig.ResumeLayout(false);
this.groupBox1.ResumeLayout(false); this.gbServers.ResumeLayout(false);
this.gbMsgTitle.ResumeLayout(false);
this.gbMsgTitle.PerformLayout();
this.cmsMsgBox.ResumeLayout(false);
this.ssMain.ResumeLayout(false);
this.ssMain.PerformLayout();
this.cmsMain.ResumeLayout(false); this.cmsMain.ResumeLayout(false);
this.tsMain.ResumeLayout(false); this.tsMain.ResumeLayout(false);
this.tsMain.PerformLayout(); this.tsMain.PerformLayout();
@@ -970,9 +907,7 @@
#endregion #endregion
private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox gbServers;
private System.Windows.Forms.GroupBox gbMsgTitle;
private System.Windows.Forms.TextBox txtMsgBox;
private v2rayN.Base.ListViewFlickerFree lvServers; private v2rayN.Base.ListViewFlickerFree lvServers;
private System.Windows.Forms.NotifyIcon notifyMain; private System.Windows.Forms.NotifyIcon notifyMain;
private System.Windows.Forms.ContextMenuStrip cmsMain; private System.Windows.Forms.ContextMenuStrip cmsMain;
@@ -996,10 +931,6 @@
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator7; private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
private System.Windows.Forms.ToolStripMenuItem menuMoveTop;
private System.Windows.Forms.ToolStripMenuItem menuMoveUp;
private System.Windows.Forms.ToolStripMenuItem menuMoveDown;
private System.Windows.Forms.ToolStripMenuItem menuMoveBottom;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; private System.Windows.Forms.ToolStripSeparator toolStripSeparator9;
private System.Windows.Forms.ToolStripMenuItem menuSysAgentMode; private System.Windows.Forms.ToolStripMenuItem menuSysAgentMode;
private System.Windows.Forms.ToolStripMenuItem menuGlobal; private System.Windows.Forms.ToolStripMenuItem menuGlobal;
@@ -1007,7 +938,7 @@
private System.Windows.Forms.ToolStripMenuItem menuAddCustomServer; private System.Windows.Forms.ToolStripMenuItem menuAddCustomServer;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem menuAddShadowsocksServer; private System.Windows.Forms.ToolStripMenuItem menuAddShadowsocksServer;
private System.Windows.Forms.SplitContainer scMain; private System.Windows.Forms.SplitContainer scServers;
private QRCodeControl qrCodeControl; private QRCodeControl qrCodeControl;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator10; private System.Windows.Forms.ToolStripSeparator toolStripSeparator10;
private System.Windows.Forms.ToolStripDropDownButton tsbCheckUpdate; private System.Windows.Forms.ToolStripDropDownButton tsbCheckUpdate;
@@ -1033,10 +964,6 @@
private System.Windows.Forms.ToolStripMenuItem tsbLanguageZhHans; private System.Windows.Forms.ToolStripMenuItem tsbLanguageZhHans;
private System.Windows.Forms.ToolStripButton tsbPromotion; private System.Windows.Forms.ToolStripButton tsbPromotion;
private System.Windows.Forms.ToolStripMenuItem menuAddSocksServer; private System.Windows.Forms.ToolStripMenuItem menuAddSocksServer;
private System.Windows.Forms.StatusStrip ssMain;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank1;
private System.Windows.Forms.ToolStripStatusLabel toolSslServerSpeed;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank4;
private System.Windows.Forms.ToolStripMenuItem menuRemoveDuplicateServer; private System.Windows.Forms.ToolStripMenuItem menuRemoveDuplicateServer;
private System.Windows.Forms.ToolStripMenuItem menuTcpingServer; private System.Windows.Forms.ToolStripMenuItem menuTcpingServer;
private System.Windows.Forms.ToolStripMenuItem menuRealPingServer; private System.Windows.Forms.ToolStripMenuItem menuRealPingServer;
@@ -1055,28 +982,32 @@
private System.Windows.Forms.ToolStripMenuItem menuClearServerStatistics; private System.Windows.Forms.ToolStripMenuItem menuClearServerStatistics;
private System.Windows.Forms.ToolStripMenuItem menuRoutings; private System.Windows.Forms.ToolStripMenuItem menuRoutings;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13; private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
private System.Windows.Forms.ContextMenuStrip cmsMsgBox;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxSelectAll;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxCopy;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxAddRoutingRule;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxCopyAll;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator14; private System.Windows.Forms.ToolStripSeparator toolStripSeparator14;
private System.Windows.Forms.ToolStripMenuItem tsbBackupGuiNConfig; private System.Windows.Forms.ToolStripMenuItem tsbBackupGuiNConfig;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator15; private System.Windows.Forms.ToolStripSeparator toolStripSeparator15;
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateGeo; private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateGeo;
private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.SplitContainer scBig;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxFilter;
private System.Windows.Forms.ToolStripStatusLabel toolSslInboundInfo;
private System.Windows.Forms.ToolStripStatusLabel toolSslRoutingRule;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank2;
private System.Windows.Forms.ToolStripComboBox menuServers2;
private System.Windows.Forms.ToolStripMenuItem tsbSubUpdateViaProxy; private System.Windows.Forms.ToolStripMenuItem tsbSubUpdateViaProxy;
private System.Windows.Forms.ToolStripMenuItem menuUpdateSubViaProxy; private System.Windows.Forms.ToolStripMenuItem menuUpdateSubViaProxy;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxClear;
private System.Windows.Forms.ToolStripMenuItem tsbGlobalHotkeySetting; private System.Windows.Forms.ToolStripMenuItem tsbGlobalHotkeySetting;
private System.Windows.Forms.TabControl tabGroup; private System.Windows.Forms.TabControl tabGroup;
private System.Windows.Forms.ToolStripMenuItem tsbGroupSetting; private System.Windows.Forms.ToolStripMenuItem tsbGroupSetting;
private System.Windows.Forms.ToolStripMenuItem menuMoveToGroup; private System.Windows.Forms.ToolStripMenuItem menuMoveToGroup;
private MainMsgControl mainMsgControl;
private System.Windows.Forms.ToolStripMenuItem menuMoveEvent;
private System.Windows.Forms.ToolStripMenuItem menuMoveTop;
private System.Windows.Forms.ToolStripMenuItem menuMoveUp;
private System.Windows.Forms.ToolStripMenuItem menuMoveDown;
private System.Windows.Forms.ToolStripMenuItem menuMoveBottom;
private System.Windows.Forms.ToolStripMenuItem menuServerFilter;
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateClashCore;
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateClashMetaCore;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator16;
private System.Windows.Forms.ToolStripMenuItem menuSortServerResult;
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateSagerNetCore;
private System.Windows.Forms.ToolStripMenuItem tsbSubGroupUpdate;
private System.Windows.Forms.ToolStripMenuItem tsbSubGroupUpdateViaProxy;
private System.Windows.Forms.ToolStripMenuItem tsbRestoreGuiNConfig;
} }
} }

View File

@@ -3,16 +3,14 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Handler; using v2rayN.Handler;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Tool;
using System.Linq;
using v2rayN.Resx; using v2rayN.Resx;
using v2rayN.Tool;
namespace v2rayN.Forms namespace v2rayN.Forms
{ {
@@ -20,20 +18,20 @@ namespace v2rayN.Forms
{ {
private V2rayHandler v2rayHandler; private V2rayHandler v2rayHandler;
private List<VmessItem> lstSelecteds = new List<VmessItem>(); private List<VmessItem> lstSelecteds = new List<VmessItem>();
private StatisticsHandler statistics = null; private StatisticsHandler statistics;
private string MsgFilter = string.Empty; private List<VmessItem> lstVmess;
private List<VmessItem> lstVmess = null; private string _groupId = string.Empty;
private string groupId = string.Empty; private string serverFilter = string.Empty;
#region Window #region Window
public MainForm() public MainForm()
{ {
InitializeComponent(); InitializeComponent();
this.ShowInTaskbar = false; ShowInTaskbar = false;
this.WindowState = FormWindowState.Minimized; WindowState = FormWindowState.Minimized;
HideForm(); HideForm();
this.Text = Utils.GetVersion(); Text = Utils.GetVersion();
Global.processJob = new Job(); Global.processJob = new Job();
Application.ApplicationExit += (sender, args) => Application.ApplicationExit += (sender, args) =>
@@ -83,12 +81,18 @@ namespace v2rayN.Forms
RefreshRoutingsMenu(); RefreshRoutingsMenu();
RestoreUI(); RestoreUI();
_ = LoadV2ray();
HideForm(); HideForm();
MainFormHandler.Instance.UpdateTask(config, UpdateTaskHandler); MainFormHandler.Instance.UpdateTask(config, UpdateTaskHandler);
MainFormHandler.Instance.RegisterGlobalHotkey(config, OnHotkeyHandler, UpdateTaskHandler); MainFormHandler.Instance.RegisterGlobalHotkey(config, OnHotkeyHandler, UpdateTaskHandler);
_ = LoadV2ray();
if (!Utils.CheckForDotNetVersion())
{
UI.ShowWarning(ResUI.NetFrameworkRequirementsTip);
AppendText(false, ResUI.NetFrameworkRequirementsTip);
}
} }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
@@ -126,7 +130,10 @@ namespace v2rayN.Forms
{ {
try try
{ {
v2rayHandler.V2rayStop(); Utils.SaveLog("MyAppExit Begin");
StorageUI();
ConfigHandler.SaveConfig(ref config);
//HttpProxyHandle.CloseHttpAgent(config); //HttpProxyHandle.CloseHttpAgent(config);
if (blWindowsShutDown) if (blWindowsShutDown)
@@ -138,26 +145,35 @@ namespace v2rayN.Forms
SysProxyHandle.UpdateSysProxy(config, true); SysProxyHandle.UpdateSysProxy(config, true);
} }
StorageUI();
ConfigHandler.SaveConfig(ref config);
statistics?.SaveToFile(); statistics?.SaveToFile();
statistics?.Close(); statistics?.Close();
v2rayHandler.V2rayStop();
Utils.SaveLog("MyAppExit End");
} }
catch { } catch { }
} }
private void RestoreUI() private void RestoreUI()
{ {
scMain.Panel2Collapsed = true; scServers.Panel2Collapsed = true;
if (!config.uiItem.mainLocation.IsEmpty) //if (!config.uiItem.mainLocation.IsEmpty)
{ //{
this.Location = config.uiItem.mainLocation; // if (config.uiItem.mainLocation.X >= SystemInformation.WorkingArea.Width
} // || config.uiItem.mainLocation.Y >= SystemInformation.WorkingArea.Height)
// {
// Location = new Point(0, 0);
// }
// else
// {
// Location = config.uiItem.mainLocation;
// }
//}
if (!config.uiItem.mainSize.IsEmpty) if (!config.uiItem.mainSize.IsEmpty)
{ {
this.Width = config.uiItem.mainSize.Width; Width = config.uiItem.mainSize.Width;
this.Height = config.uiItem.mainSize.Height; Height = config.uiItem.mainSize.Height;
} }
@@ -170,9 +186,9 @@ namespace v2rayN.Forms
private void StorageUI() private void StorageUI()
{ {
config.uiItem.mainLocation = this.Location; config.uiItem.mainLocation = Location;
config.uiItem.mainSize = new Size(this.Width, this.Height); config.uiItem.mainSize = new Size(Width, Height);
for (int k = 0; k < lvServers.Columns.Count; k++) for (int k = 0; k < lvServers.Columns.Count; k++)
{ {
@@ -185,7 +201,7 @@ namespace v2rayN.Forms
switch (Utils.ToInt(e.Name)) switch (Utils.ToInt(e.Name))
{ {
case (int)EGlobalHotkey.ShowForm: case (int)EGlobalHotkey.ShowForm:
if (this.ShowInTaskbar) HideForm(); else ShowForm(); if (ShowInTaskbar) HideForm(); else ShowForm();
break; break;
case (int)EGlobalHotkey.SystemProxyClear: case (int)EGlobalHotkey.SystemProxyClear:
SetListenerType(ESysProxyType.ForcedClear); SetListenerType(ESysProxyType.ForcedClear);
@@ -210,12 +226,17 @@ namespace v2rayN.Forms
private void RefreshServers() private void RefreshServers()
{ {
lstVmess = config.vmess lstVmess = config.vmess
.Where(it => Utils.IsNullOrEmpty(groupId) ? true : it.groupId == groupId) .Where(it => Utils.IsNullOrEmpty(_groupId) || it.groupId == _groupId)
.Where(it => Utils.IsNullOrEmpty(serverFilter) || it.remarks.Contains(serverFilter))
.OrderBy(it => it.sort) .OrderBy(it => it.sort)
.ToList(); .ToList();
ConfigHandler.SetDefaultServer(config, lstVmess); ConfigHandler.SetDefaultServer(config, lstVmess);
RefreshServersView(); BeginInvoke(new Action(() =>
{
RefreshServersView();
}));
RefreshServersMenu(); RefreshServersMenu();
} }
@@ -280,11 +301,11 @@ namespace v2rayN.Forms
for (int k = 0; k < lstVmess.Count; k++) for (int k = 0; k < lstVmess.Count; k++)
{ {
string def = string.Empty; string def = (k + 1).ToString();
VmessItem item = lstVmess[k]; VmessItem item = lstVmess[k];
if (config.IsActiveNode(item)) if (config.IsActiveNode(item))
{ {
def = "√"; def = Global.CheckMark;
} }
ListViewItem lvItem = new ListViewItem(def); ListViewItem lvItem = new ListViewItem(def);
@@ -337,7 +358,7 @@ namespace v2rayN.Forms
if (index >= 0 && index < lvServers.Items.Count && lvServers.Items.Count > 0) if (index >= 0 && index < lvServers.Items.Count && lvServers.Items.Count > 0)
{ {
lvServers.Items[index].Selected = true; lvServers.Items[index].Selected = true;
lvServers.EnsureVisible(index); // workaround lvServers.SetScrollPosition(index);
} }
} }
@@ -347,56 +368,32 @@ namespace v2rayN.Forms
private void RefreshServersMenu() private void RefreshServersMenu()
{ {
menuServers.DropDownItems.Clear(); menuServers.DropDownItems.Clear();
menuServers2.SelectedIndexChanged -= MenuServers2_SelectedIndexChanged;
menuServers2.Items.Clear();
menuServers.Visible = false;
menuServers2.Visible = false;
if (lstVmess.Count > 20) if (lstVmess.Count > config.trayMenuServersLimit)
{ {
for (int k = 0; k < lstVmess.Count; k++) menuServers.DropDownItems.Add(new ToolStripMenuItem(ResUI.TooManyServersTip));
{ return;
VmessItem item = lstVmess[k];
string name = item.GetSummary();
if (config.IsActiveNode(item))
{
name = $"√ {name}";
}
menuServers2.Items.Add(name);
}
menuServers2.SelectedIndex = lstVmess.FindIndex(it => it.indexId == config.indexId);
menuServers2.SelectedIndexChanged += MenuServers2_SelectedIndexChanged;
menuServers2.Visible = true;
} }
else
List<ToolStripMenuItem> lst = new List<ToolStripMenuItem>();
for (int k = 0; k < lstVmess.Count; k++)
{ {
List<ToolStripMenuItem> lst = new List<ToolStripMenuItem>(); VmessItem item = lstVmess[k];
for (int k = 0; k < lstVmess.Count; k++) string name = item.GetSummary();
ToolStripMenuItem ts = new ToolStripMenuItem(name)
{ {
VmessItem item = lstVmess[k]; Tag = k
string name = item.GetSummary(); };
if (config.IsActiveNode(item))
ToolStripMenuItem ts = new ToolStripMenuItem(name) {
{ ts.Checked = true;
Tag = k
};
if (config.IsActiveNode(item))
{
ts.Checked = true;
}
ts.Click += new EventHandler(ts_Click);
lst.Add(ts);
} }
menuServers.DropDownItems.AddRange(lst.ToArray()); ts.Click += ts_Click;
menuServers.Visible = true; lst.Add(ts);
} }
} menuServers.DropDownItems.AddRange(lst.ToArray());
menuServers.Visible = true;
private void MenuServers2_SelectedIndexChanged(object sender, EventArgs e)
{
SetDefaultServer(((ToolStripComboBox)sender).SelectedIndex);
} }
private void ts_Click(object sender, EventArgs e) private void ts_Click(object sender, EventArgs e)
@@ -416,13 +413,6 @@ namespace v2rayN.Forms
{ {
} }
private void ssMain_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
if (!Utils.IsNullOrEmpty(e.ClickedItem.Text))
{
Utils.SetClipboardData(e.ClickedItem.Text);
}
}
private void lvServers_ColumnClick(object sender, ColumnClickEventArgs e) private void lvServers_ColumnClick(object sender, ColumnClickEventArgs e)
{ {
@@ -443,7 +433,7 @@ namespace v2rayN.Forms
} }
var tag = lvServers.Columns[e.Column].Tag?.ToString(); var tag = lvServers.Columns[e.Column].Tag?.ToString();
bool asc = Utils.IsNullOrEmpty(tag) ? true : !Convert.ToBoolean(tag); bool asc = Utils.IsNullOrEmpty(tag) || !Convert.ToBoolean(tag);
if (ConfigHandler.SortServers(ref config, ref lstVmess, (EServerColName)e.Column, asc) != 0) if (ConfigHandler.SortServers(ref config, ref lstVmess, (EServerColName)e.Column, asc) != 0)
{ {
return; return;
@@ -472,7 +462,7 @@ namespace v2rayN.Forms
tabPage.Name = ""; tabPage.Name = "";
tabGroup.TabPages.Add(tabPage); tabGroup.TabPages.Add(tabPage);
foreach (var item in config.groupItem) foreach (var item in config.groupItem.OrderBy(t => t.sort))
{ {
var tabPage2 = new TabPage($" {item.remarks} "); var tabPage2 = new TabPage($" {item.remarks} ");
tabPage2.Name = item.id; tabPage2.Name = item.id;
@@ -493,7 +483,7 @@ namespace v2rayN.Forms
{ {
Tag = item.id, Tag = item.id,
}; };
ts.Click += new EventHandler(ts_Group_Click); ts.Click += ts_Group_Click;
lst.Add(ts); lst.Add(ts);
} }
menuMoveToGroup.DropDownItems.AddRange(lst.ToArray()); menuMoveToGroup.DropDownItems.AddRange(lst.ToArray());
@@ -505,9 +495,9 @@ namespace v2rayN.Forms
{ {
return; return;
} }
groupId = string.Empty; _groupId = string.Empty;
//groupId = tabGroup.TabPages[tabGroup.SelectedIndex].Name; //groupId = tabGroup.TabPages[tabGroup.SelectedIndex].Name;
groupId = tabGroup.SelectedTab.Name; _groupId = tabGroup.SelectedTab.Name;
RefreshServers(); RefreshServers();
@@ -539,17 +529,19 @@ namespace v2rayN.Forms
#endregion #endregion
#region v2ray #region v2ray
/// <summary> /// <summary>
/// 载入V2ray /// 载入V2ray
/// </summary> /// </summary>
async Task LoadV2ray() async Task LoadV2ray()
{ {
tsbReload.Enabled = false; BeginInvoke(new Action(() =>
{
tsbReload.Enabled = false;
}));
if (Global.reloadV2ray) if (Global.reloadV2ray)
{ {
ClearMsg(); mainMsgControl.ClearMsg();
} }
await Task.Run(() => await Task.Run(() =>
{ {
@@ -562,7 +554,10 @@ namespace v2rayN.Forms
ChangePACButtonStatus(config.sysProxyType); ChangePACButtonStatus(config.sysProxyType);
tsbReload.Enabled = true; BeginInvoke(new Action(() =>
{
tsbReload.Enabled = true;
}));
} }
/// <summary> /// <summary>
@@ -613,7 +608,7 @@ namespace v2rayN.Forms
fm = new AddServerForm(); fm = new AddServerForm();
} }
fm.vmessItem = index >= 0 ? lstVmess[index] : null; fm.vmessItem = index >= 0 ? lstVmess[index] : null;
fm.groupId = groupId; fm.groupId = _groupId;
fm.eConfigType = configType; fm.eConfigType = configType;
if (fm.ShowDialog() == DialogResult.OK) if (fm.ShowDialog() == DialogResult.OK)
{ {
@@ -653,6 +648,12 @@ namespace v2rayN.Forms
case Keys.T: case Keys.T:
menuSpeedServer_Click(null, null); menuSpeedServer_Click(null, null);
break; break;
case Keys.F:
menuServerFilter_Click(null, null);
break;
case Keys.E:
menuSortServerResult_Click(null, null);
break;
} }
} }
else else
@@ -683,7 +684,7 @@ namespace v2rayN.Forms
private void menuAddVmessServer_Click(object sender, EventArgs e) private void menuAddVmessServer_Click(object sender, EventArgs e)
{ {
ShowServerForm(EConfigType.Vmess, -1); ShowServerForm(EConfigType.VMess, -1);
} }
private void menuAddVlessServer_Click(object sender, EventArgs e) private void menuAddVlessServer_Click(object sender, EventArgs e)
@@ -742,6 +743,17 @@ namespace v2rayN.Forms
SetDefaultServer(index); SetDefaultServer(index);
} }
private void menuServerFilter_Click(object sender, EventArgs e)
{
var fm = new MsgFilterSetForm();
fm.MsgFilter = serverFilter;
if (fm.ShowDialog() == DialogResult.OK)
{
serverFilter = fm.MsgFilter;
gbServers.Text = string.Format(ResUI.MsgServerTitle, serverFilter);
RefreshServers();
}
}
private void menuPingServer_Click(object sender, EventArgs e) private void menuPingServer_Click(object sender, EventArgs e)
{ {
@@ -783,11 +795,15 @@ namespace v2rayN.Forms
ClearTestResult(); ClearTestResult();
SpeedtestHandler statistics = new SpeedtestHandler(config, v2rayHandler, lstSelecteds, actionType, UpdateSpeedtestHandler); SpeedtestHandler statistics = new SpeedtestHandler(config, v2rayHandler, lstSelecteds, actionType, UpdateSpeedtestHandler);
} }
private void menuSortServerResult_Click(object sender, EventArgs e)
{
lvServers_ColumnClick(null, new ColumnClickEventArgs((int)EServerColName.testResult));
}
private void tsbTestMe_Click(object sender, EventArgs e) private void tsbTestMe_Click(object sender, EventArgs e)
{ {
string result = (new DownloadHandle()).RunAvailabilityCheck(null) + "ms"; var updateHandle = new UpdateHandle();
AppendText(false, string.Format(ResUI.TestMeOutput, result)); updateHandle.RunAvailabilityCheck(UpdateTaskHandler);
} }
private void menuClearStatistic_Click(object sender, EventArgs e) private void menuClearStatistic_Click(object sender, EventArgs e)
@@ -795,18 +811,27 @@ namespace v2rayN.Forms
if (statistics != null) if (statistics != null)
{ {
statistics.ClearAllServerStatistics(); statistics.ClearAllServerStatistics();
RefreshServers();
} }
} }
private void menuExport2ClientConfig_Click(object sender, EventArgs e) private void menuExport2ClientConfig_Click(object sender, EventArgs e)
{ {
int index = GetLvSelectedIndex(); int index = GetLvSelectedIndex();
if (index < 0)
{
return;
}
MainFormHandler.Instance.Export2ClientConfig(lstVmess[index], config); MainFormHandler.Instance.Export2ClientConfig(lstVmess[index], config);
} }
private void menuExport2ServerConfig_Click(object sender, EventArgs e) private void menuExport2ServerConfig_Click(object sender, EventArgs e)
{ {
int index = GetLvSelectedIndex(); int index = GetLvSelectedIndex();
if (index < 0)
{
return;
}
MainFormHandler.Instance.Export2ServerConfig(lstVmess[index], config); MainFormHandler.Instance.Export2ServerConfig(lstVmess[index], config);
} }
@@ -881,9 +906,9 @@ namespace v2rayN.Forms
var fm = new GlobalHotkeySettingForm(); var fm = new GlobalHotkeySettingForm();
if (fm.ShowDialog() == DialogResult.OK) if (fm.ShowDialog() == DialogResult.OK)
{ {
RefreshRoutingsMenu(); //RefreshRoutingsMenu();
RefreshServers(); //RefreshServers();
_ = LoadV2ray(); //_ = LoadV2ray();
} }
} }
@@ -926,7 +951,23 @@ namespace v2rayN.Forms
} }
if (ConfigHandler.SetDefaultServer(ref config, lstVmess[index]) == 0) if (ConfigHandler.SetDefaultServer(ref config, lstVmess[index]) == 0)
{ {
RefreshServers(); //RefreshServers();
for (int k = 0; k < lstVmess.Count; k++)
{
if (config.IsActiveNode(lstVmess[k]))
{
lvServers.Items[k].SubItems[0].Text = Global.CheckMark;
lvServers.Items[k].ForeColor = Color.DodgerBlue;
lvServers.Items[k].Font = new Font(lvServers.Font, FontStyle.Bold);
}
else
{
lvServers.Items[k].SubItems[0].Text = (k + 1).ToString();
lvServers.Items[k].ForeColor = lvServers.ForeColor;
lvServers.Items[k].Font = new Font(lvServers.Font, FontStyle.Regular);
}
}
RefreshServersMenu();
_ = LoadV2ray(); _ = LoadV2ray();
} }
return 0; return 0;
@@ -990,7 +1031,7 @@ namespace v2rayN.Forms
private void menuAddServers_Click(object sender, EventArgs e) private void menuAddServers_Click(object sender, EventArgs e)
{ {
string clipboardData = Utils.GetClipboardData(); string clipboardData = Utils.GetClipboardData();
int ret = ConfigHandler.AddBatchServers(ref config, clipboardData, "", groupId); int ret = ConfigHandler.AddBatchServers(ref config, clipboardData, "", _groupId);
if (ret > 0) if (ret > 0)
{ {
RefreshServers(); RefreshServers();
@@ -1020,7 +1061,7 @@ namespace v2rayN.Forms
} }
else else
{ {
int ret = ConfigHandler.AddBatchServers(ref config, result, "", groupId); int ret = ConfigHandler.AddBatchServers(ref config, result, "", _groupId);
if (ret > 0) if (ret > 0)
{ {
RefreshServers(); RefreshServers();
@@ -1031,17 +1072,25 @@ namespace v2rayN.Forms
private void menuUpdateSubscriptions_Click(object sender, EventArgs e) private void menuUpdateSubscriptions_Click(object sender, EventArgs e)
{ {
UpdateSubscriptionProcess(false); UpdateSubscriptionProcess("", false);
} }
private void menuUpdateSubViaProxy_Click(object sender, EventArgs e) private void menuUpdateSubViaProxy_Click(object sender, EventArgs e)
{ {
UpdateSubscriptionProcess(true); UpdateSubscriptionProcess("", true);
} }
private void tsbBackupGuiNConfig_Click(object sender, EventArgs e) private void tsbBackupGuiNConfig_Click(object sender, EventArgs e)
{ {
MainFormHandler.Instance.BackupGuiNConfig(config); MainFormHandler.Instance.BackupGuiNConfig(config);
} }
private void tsbRestoreGuiNConfig_Click(object sender, EventArgs e)
{
if (MainFormHandler.Instance.RestoreGuiNConfig(ref config))
{
RefreshServers();
}
}
#endregion #endregion
@@ -1057,68 +1106,17 @@ namespace v2rayN.Forms
AppendText(notify, msg); AppendText(notify, msg);
} }
delegate void AppendTextDelegate(string text);
void AppendText(bool notify, string msg) void AppendText(bool notify, string msg)
{ {
try try
{ {
AppendText(msg); mainMsgControl.AppendText(msg);
if (notify) if (notify)
{ {
notifyMsg(msg); notifyMsg(msg);
} }
} }
catch catch { }
{
}
}
void AppendText(string text)
{
if (this.txtMsgBox.InvokeRequired)
{
Invoke(new AppendTextDelegate(AppendText), new object[] { text });
}
else
{
if (!Utils.IsNullOrEmpty(MsgFilter))
{
if (!Regex.IsMatch(text, MsgFilter))
{
return;
}
}
//this.txtMsgBox.AppendText(text);
ShowMsg(text);
}
}
/// <summary>
/// 提示信息
/// </summary>
/// <param name="msg"></param>
private void ShowMsg(string msg)
{
if (txtMsgBox.Lines.Length > 999)
{
ClearMsg();
}
this.txtMsgBox.AppendText(msg);
if (!msg.EndsWith(Environment.NewLine))
{
this.txtMsgBox.AppendText(Environment.NewLine);
}
}
/// <summary>
/// 清除信息
/// </summary>
private void ClearMsg()
{
txtMsgBox.Invoke((Action)delegate
{
txtMsgBox.Clear();
});
} }
/// <summary> /// <summary>
@@ -1127,7 +1125,7 @@ namespace v2rayN.Forms
/// <param name="msg"></param> /// <param name="msg"></param>
private void notifyMsg(string msg) private void notifyMsg(string msg)
{ {
notifyMain.Text = msg; notifyMain.Text = (msg.Length <= 63 ? msg : msg.Substring(1, 63));
} }
#endregion #endregion
@@ -1145,8 +1143,8 @@ namespace v2rayN.Forms
private void menuExit_Click(object sender, EventArgs e) private void menuExit_Click(object sender, EventArgs e)
{ {
this.Visible = false; Visible = false;
this.Close(); Close();
Application.Exit(); Application.Exit();
} }
@@ -1154,21 +1152,21 @@ namespace v2rayN.Forms
private void ShowForm() private void ShowForm()
{ {
this.Show(); Show();
if (this.WindowState == FormWindowState.Minimized) if (WindowState == FormWindowState.Minimized)
{ {
this.WindowState = FormWindowState.Normal; WindowState = FormWindowState.Normal;
} }
this.Activate(); Activate();
this.ShowInTaskbar = true; ShowInTaskbar = true;
//this.notifyIcon1.Visible = false; //this.notifyIcon1.Visible = false;
this.txtMsgBox.ScrollToCaret(); mainMsgControl.ScrollToCaret();
int index = GetLvSelectedIndex(false); int index = GetLvSelectedIndex(false);
if (index >= 0 && index < lvServers.Items.Count && lvServers.Items.Count > 0) if (index >= 0 && index < lvServers.Items.Count && lvServers.Items.Count > 0)
{ {
lvServers.Items[index].Selected = true; lvServers.Items[index].Selected = true;
lvServers.EnsureVisible(index); // workaround lvServers.SetScrollPosition(index);
} }
SetVisibleCore(true); SetVisibleCore(true);
@@ -1177,12 +1175,18 @@ namespace v2rayN.Forms
private void HideForm() private void HideForm()
{ {
//this.WindowState = FormWindowState.Minimized; //this.WindowState = FormWindowState.Minimized;
this.Hide(); Hide();
//this.notifyMain.Icon = this.Icon; //this.notifyMain.Icon = this.Icon;
this.notifyMain.Visible = true; notifyMain.Visible = true;
this.ShowInTaskbar = false; ShowInTaskbar = false;
SetVisibleCore(false); SetVisibleCore(false);
//write Handle to reg
if (IsHandleCreated)
{
Utils.RegWriteValue(Global.MyRegPath, Utils.WindowHwndKey, Convert.ToString((long)Handle));
}
} }
#endregion #endregion
@@ -1228,9 +1232,9 @@ namespace v2rayN.Forms
{ {
try try
{ {
up /= (ulong)(config.statisticsFreshRate / 1000f); up /= (ulong)(config.statisticsFreshRate);
down /= (ulong)(config.statisticsFreshRate / 1000f); down /= (ulong)(config.statisticsFreshRate);
toolSslServerSpeed.Text = string.Format("{0}/s↑ | {1}/s↓", Utils.HumanFy(up), Utils.HumanFy(down)); mainMsgControl.SetToolSslInfo("speed", string.Format("{0}/s↑ | {1}/s↓", Utils.HumanFy(up), Utils.HumanFy(down)));
foreach (var it in statistics) foreach (var it in statistics)
{ {
@@ -1259,13 +1263,14 @@ namespace v2rayN.Forms
} }
} }
private void UpdateTaskHandler(bool success, string msg) private async void UpdateTaskHandler(bool success, string msg)
{ {
AppendText(false, msg); AppendText(false, msg);
if (success) if (success)
{ {
RefreshServers();
Global.reloadV2ray = true; Global.reloadV2ray = true;
_ = LoadV2ray(); await LoadV2ray();
} }
} }
#endregion #endregion
@@ -1297,7 +1302,6 @@ namespace v2rayN.Forms
int index = GetLvSelectedIndex(); int index = GetLvSelectedIndex();
if (index < 0) if (index < 0)
{ {
UI.Show(ResUI.PleaseSelectServer);
return; return;
} }
if (ConfigHandler.MoveServer(ref config, ref lstVmess, index, eMove) == 0) if (ConfigHandler.MoveServer(ref config, ref lstVmess, index, eMove) == 0)
@@ -1350,26 +1354,15 @@ namespace v2rayN.Forms
} }
ConfigHandler.SaveConfig(ref config, false); ConfigHandler.SaveConfig(ref config, false);
DisplayToolStatus();
}
private void DisplayToolStatus() mainMsgControl.DisplayToolStatus(config);
{
StringBuilder sb = new StringBuilder();
sb.Append($"{Global.InboundSocks} {Global.Loopback}:{config.GetLocalPort(Global.InboundSocks)}");
sb.Append(" | ");
sb.Append($"{Global.InboundHttp} {Global.Loopback}:{config.GetLocalPort(Global.InboundHttp)}");
if (config.sysProxyType == ESysProxyType.ForcedChange) BeginInvoke(new Action(() =>
{ {
sb.Append(" | "); notifyMain.Icon = Icon = MainFormHandler.Instance.GetNotifyIcon(config, Icon);
sb.Append($"{ResUI.SystemProxy} {Global.Loopback}:{config.GetLocalPort(Global.InboundHttp2)}"); }));
}
toolSslInboundInfo.Text = sb.ToString();
notifyMain.Icon = MainFormHandler.Instance.GetNotifyIcon(config, this.Icon);
} }
#endregion #endregion
@@ -1385,12 +1378,17 @@ namespace v2rayN.Forms
menuExit_Click(null, null); menuExit_Click(null, null);
} }
}; };
(new UpdateHandle()).CheckUpdateGuiN(config, _updateUI); (new UpdateHandle()).CheckUpdateGuiN(config, _updateUI, config.checkPreReleaseUpdate);
} }
private void tsbCheckUpdateCore_Click(object sender, EventArgs e) private void tsbCheckUpdateCore_Click(object sender, EventArgs e)
{ {
CheckUpdateCore(ECoreType.v2fly); CheckUpdateCore(ECoreType.v2fly_v5);
}
private void tsbCheckUpdateSagerNetCore_Click(object sender, EventArgs e)
{
CheckUpdateCore(ECoreType.SagerNet);
} }
private void tsbCheckUpdateXrayCore_Click(object sender, EventArgs e) private void tsbCheckUpdateXrayCore_Click(object sender, EventArgs e)
@@ -1398,6 +1396,16 @@ namespace v2rayN.Forms
CheckUpdateCore(ECoreType.Xray); CheckUpdateCore(ECoreType.Xray);
} }
private void tsbCheckUpdateClashCore_Click(object sender, EventArgs e)
{
CheckUpdateCore(ECoreType.clash);
}
private void tsbCheckUpdateClashMetaCore_Click(object sender, EventArgs e)
{
CheckUpdateCore(ECoreType.clash_meta);
}
private void CheckUpdateCore(ECoreType type) private void CheckUpdateCore(ECoreType type)
{ {
void _updateUI(bool success, string msg) void _updateUI(bool success, string msg)
@@ -1418,7 +1426,7 @@ namespace v2rayN.Forms
AppendText(false, ResUI.MsgUpdateV2rayCoreSuccessfully); AppendText(false, ResUI.MsgUpdateV2rayCoreSuccessfully);
} }
}; };
(new UpdateHandle()).CheckUpdateCore(type, config, _updateUI); (new UpdateHandle()).CheckUpdateCore(type, config, _updateUI, config.checkPreReleaseUpdate);
} }
private void tsbCheckUpdateGeo_Click(object sender, EventArgs e) private void tsbCheckUpdateGeo_Click(object sender, EventArgs e)
@@ -1464,18 +1472,27 @@ namespace v2rayN.Forms
private void tsbSubUpdate_Click(object sender, EventArgs e) private void tsbSubUpdate_Click(object sender, EventArgs e)
{ {
UpdateSubscriptionProcess(false); UpdateSubscriptionProcess("", false);
} }
private void tsbSubUpdateViaProxy_Click(object sender, EventArgs e) private void tsbSubUpdateViaProxy_Click(object sender, EventArgs e)
{ {
UpdateSubscriptionProcess(true); UpdateSubscriptionProcess("", true);
}
private void tsbSubGroupUpdate_Click(object sender, EventArgs e)
{
UpdateSubscriptionProcess(_groupId, true);
}
private void tsbSubGroupUpdateViaProxy_Click(object sender, EventArgs e)
{
UpdateSubscriptionProcess(_groupId, true);
} }
/// <summary> /// <summary>
/// the subscription update process /// the subscription update process
/// </summary> /// </summary>
private void UpdateSubscriptionProcess(bool blProxy) private void UpdateSubscriptionProcess(string groupId, bool blProxy)
{ {
void _updateUI(bool success, string msg) void _updateUI(bool success, string msg)
{ {
@@ -1493,13 +1510,13 @@ namespace v2rayN.Forms
} }
}; };
(new UpdateHandle()).UpdateSubscriptionProcess(config, blProxy, _updateUI); (new UpdateHandle()).UpdateSubscriptionProcess(config, groupId, blProxy, _updateUI);
} }
private void tsbQRCodeSwitch_CheckedChanged(object sender, EventArgs e) private void tsbQRCodeSwitch_CheckedChanged(object sender, EventArgs e)
{ {
bool bShow = tsbQRCodeSwitch.Checked; bool bShow = tsbQRCodeSwitch.Checked;
scMain.Panel2Collapsed = !bShow; scServers.Panel2Collapsed = !bShow;
} }
#endregion #endregion
@@ -1520,10 +1537,6 @@ namespace v2rayN.Forms
//Application.Restart(); //Application.Restart();
} }
#endregion #endregion
@@ -1537,7 +1550,7 @@ namespace v2rayN.Forms
menuRoutings.Visible = config.enableRoutingAdvanced; menuRoutings.Visible = config.enableRoutingAdvanced;
if (!config.enableRoutingAdvanced) if (!config.enableRoutingAdvanced)
{ {
toolSslRoutingRule.Text = string.Empty; mainMsgControl.SetToolSslInfo("routing", string.Empty);
return; return;
} }
@@ -1560,9 +1573,9 @@ namespace v2rayN.Forms
if (config.routingIndex.Equals(k)) if (config.routingIndex.Equals(k))
{ {
ts.Checked = true; ts.Checked = true;
toolSslRoutingRule.Text = item.remarks; mainMsgControl.SetToolSslInfo("routing", item.remarks);
} }
ts.Click += new EventHandler(ts_Routing_Click); ts.Click += ts_Routing_Click;
lst.Add(ts); lst.Add(ts);
} }
menuRoutings.DropDownItems.AddRange(lst.ToArray()); menuRoutings.DropDownItems.AddRange(lst.ToArray());
@@ -1587,65 +1600,5 @@ namespace v2rayN.Forms
} }
#endregion #endregion
#region MsgBoxMenu
private void menuMsgBoxSelectAll_Click(object sender, EventArgs e)
{
this.txtMsgBox.Focus();
this.txtMsgBox.SelectAll();
}
private void menuMsgBoxCopy_Click(object sender, EventArgs e)
{
var data = this.txtMsgBox.SelectedText.TrimEx();
Utils.SetClipboardData(data);
}
private void menuMsgBoxCopyAll_Click(object sender, EventArgs e)
{
var data = this.txtMsgBox.Text;
Utils.SetClipboardData(data);
}
private void menuMsgBoxClear_Click(object sender, EventArgs e)
{
this.txtMsgBox.Clear();
}
private void menuMsgBoxAddRoutingRule_Click(object sender, EventArgs e)
{
menuMsgBoxCopy_Click(null, null);
tsbRoutingSetting_Click(null, null);
}
private void txtMsgBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control)
{
switch (e.KeyCode)
{
case Keys.A:
menuMsgBoxSelectAll_Click(null, null);
break;
case Keys.C:
menuMsgBoxCopy_Click(null, null);
break;
case Keys.V:
menuMsgBoxAddRoutingRule_Click(null, null);
break;
}
}
}
private void menuMsgBoxFilter_Click(object sender, EventArgs e)
{
var fm = new MsgFilterSetForm();
fm.MsgFilter = MsgFilter;
if (fm.ShowDialog() == DialogResult.OK)
{
MsgFilter = fm.MsgFilter;
gbMsgTitle.Text = string.Format(ResUI.MsgInformationTitle, MsgFilter);
}
}
#endregion
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -321,48 +321,27 @@
<data name="menuMsgBoxSelectAll.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuMsgBoxSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value> <value>221, 22</value>
</data> </data>
<data name="menuMsgBoxSelectAll.Text" xml:space="preserve">
<value>全选 (Ctrl+A)</value>
</data>
<data name="menuMsgBoxCopy.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuMsgBoxCopy.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value> <value>221, 22</value>
</data> </data>
<data name="menuMsgBoxCopy.Text" xml:space="preserve">
<value>复制 (Ctrl+C)</value>
</data>
<data name="menuMsgBoxCopyAll.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuMsgBoxCopyAll.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value> <value>221, 22</value>
</data> </data>
<data name="menuMsgBoxCopyAll.Text" xml:space="preserve">
<value>复制所有</value>
</data>
<data name="menuMsgBoxClear.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuMsgBoxClear.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value> <value>221, 22</value>
</data> </data>
<data name="menuMsgBoxClear.Text" xml:space="preserve">
<value>清除所有</value>
</data>
<data name="menuMsgBoxAddRoutingRule.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuMsgBoxAddRoutingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value> <value>221, 22</value>
</data> </data>
<data name="menuMsgBoxAddRoutingRule.Text" xml:space="preserve">
<value>快速添加路由规则 (Ctrl+V)</value>
</data>
<data name="menuMsgBoxFilter.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuMsgBoxFilter.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value> <value>221, 22</value>
</data> </data>
<data name="menuMsgBoxFilter.Text" xml:space="preserve">
<value>设置信息过滤器</value>
</data>
<data name="cmsMsgBox.Size" type="System.Drawing.Size, System.Drawing"> <data name="cmsMsgBox.Size" type="System.Drawing.Size, System.Drawing">
<value>222, 136</value> <value>222, 136</value>
</data> </data>
<data name="toolSslServerSpeed.Text" xml:space="preserve"> <data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>网速显示未启用</value> <value>网速显示未启用</value>
</data> </data>
<data name="gbMsgTitle.Text" xml:space="preserve">
<value>信息</value>
</data>
<data name="menuKeepClear.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuKeepClear.Size" type="System.Drawing.Size, System.Drawing">
<value>172, 22</value> <value>172, 22</value>
</data> </data>
@@ -526,7 +505,7 @@
<value>168, 22</value> <value>168, 22</value>
</data> </data>
<data name="tsbCheckUpdateCore.Text" xml:space="preserve"> <data name="tsbCheckUpdateCore.Text" xml:space="preserve">
<value>v2fly-Core</value> <value>v2fly_v5-Core</value>
</data> </data>
<data name="tsbCheckUpdateXrayCore.Size" type="System.Drawing.Size, System.Drawing"> <data name="tsbCheckUpdateXrayCore.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 22</value> <value>168, 22</value>
@@ -576,4 +555,31 @@
<data name="menuMoveToGroup.Text" xml:space="preserve"> <data name="menuMoveToGroup.Text" xml:space="preserve">
<value>移至分组</value> <value>移至分组</value>
</data> </data>
<data name="menuMoveEvent.Text" xml:space="preserve">
<value>上下移至</value>
</data>
<data name="menuServerFilter.Text" xml:space="preserve">
<value>设置服务器过滤器 (Ctrl+F)</value>
</data>
<data name="tsbCheckUpdateClashCore.Text" xml:space="preserve">
<value>Update clash Core</value>
</data>
<data name="tsbCheckUpdateClashMetaCore.Text" xml:space="preserve">
<value>Update Clash.Meta Core</value>
</data>
<data name="menuSortServerResult.Text" xml:space="preserve">
<value>按测试结果排序 (Ctrl+E)</value>
</data>
<data name="tsbCheckUpdateSagerNetCore.Text" xml:space="preserve">
<value>SagerNet-Core</value>
</data>
<data name="tsbSubGroupUpdate.Text" xml:space="preserve">
<value>更新当前分组订阅(不通过代理)</value>
</data>
<data name="tsbSubGroupUpdateViaProxy.Text" xml:space="preserve">
<value>更新当前分组订阅(通过代理)</value>
</data>
<data name="tsbRestoreGuiNConfig.Text" xml:space="preserve">
<value>恢复v2rayN配置文件</value>
</data>
</root> </root>

View File

@@ -0,0 +1,204 @@

namespace v2rayN.Forms
{
partial class MainMsgControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainMsgControl));
this.txtMsgBox = new System.Windows.Forms.TextBox();
this.cmsMsgBox = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuMsgBoxSelectAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxCopy = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxCopyAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxClear = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxAddRoutingRule = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxFilter = new System.Windows.Forms.ToolStripMenuItem();
this.gbMsgTitle = new System.Windows.Forms.GroupBox();
this.ssMain = new System.Windows.Forms.StatusStrip();
this.toolSslInboundInfo = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank1 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslRoutingRule = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank2 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslServerSpeed = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank4 = new System.Windows.Forms.ToolStripStatusLabel();
this.cmsMsgBox.SuspendLayout();
this.gbMsgTitle.SuspendLayout();
this.ssMain.SuspendLayout();
this.SuspendLayout();
//
// txtMsgBox
//
resources.ApplyResources(this.txtMsgBox, "txtMsgBox");
this.txtMsgBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(49)))), ((int)(((byte)(52)))));
this.txtMsgBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtMsgBox.ContextMenuStrip = this.cmsMsgBox;
this.txtMsgBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(226)))), ((int)(((byte)(228)))));
this.txtMsgBox.Name = "txtMsgBox";
this.txtMsgBox.ReadOnly = true;
this.txtMsgBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtMsgBox_KeyDown);
//
// cmsMsgBox
//
resources.ApplyResources(this.cmsMsgBox, "cmsMsgBox");
this.cmsMsgBox.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuMsgBoxSelectAll,
this.menuMsgBoxCopy,
this.menuMsgBoxCopyAll,
this.menuMsgBoxClear,
this.menuMsgBoxAddRoutingRule,
this.menuMsgBoxFilter});
this.cmsMsgBox.Name = "cmsMsgBox";
//
// menuMsgBoxSelectAll
//
resources.ApplyResources(this.menuMsgBoxSelectAll, "menuMsgBoxSelectAll");
this.menuMsgBoxSelectAll.Name = "menuMsgBoxSelectAll";
this.menuMsgBoxSelectAll.Click += new System.EventHandler(this.menuMsgBoxSelectAll_Click);
//
// menuMsgBoxCopy
//
resources.ApplyResources(this.menuMsgBoxCopy, "menuMsgBoxCopy");
this.menuMsgBoxCopy.Name = "menuMsgBoxCopy";
this.menuMsgBoxCopy.Click += new System.EventHandler(this.menuMsgBoxCopy_Click);
//
// menuMsgBoxCopyAll
//
resources.ApplyResources(this.menuMsgBoxCopyAll, "menuMsgBoxCopyAll");
this.menuMsgBoxCopyAll.Name = "menuMsgBoxCopyAll";
this.menuMsgBoxCopyAll.Click += new System.EventHandler(this.menuMsgBoxCopyAll_Click);
//
// menuMsgBoxClear
//
resources.ApplyResources(this.menuMsgBoxClear, "menuMsgBoxClear");
this.menuMsgBoxClear.Name = "menuMsgBoxClear";
this.menuMsgBoxClear.Click += new System.EventHandler(this.menuMsgBoxClear_Click);
//
// menuMsgBoxAddRoutingRule
//
resources.ApplyResources(this.menuMsgBoxAddRoutingRule, "menuMsgBoxAddRoutingRule");
this.menuMsgBoxAddRoutingRule.Name = "menuMsgBoxAddRoutingRule";
this.menuMsgBoxAddRoutingRule.Click += new System.EventHandler(this.menuMsgBoxAddRoutingRule_Click);
//
// menuMsgBoxFilter
//
resources.ApplyResources(this.menuMsgBoxFilter, "menuMsgBoxFilter");
this.menuMsgBoxFilter.Name = "menuMsgBoxFilter";
this.menuMsgBoxFilter.Click += new System.EventHandler(this.menuMsgBoxFilter_Click);
//
// gbMsgTitle
//
resources.ApplyResources(this.gbMsgTitle, "gbMsgTitle");
this.gbMsgTitle.Controls.Add(this.txtMsgBox);
this.gbMsgTitle.Controls.Add(this.ssMain);
this.gbMsgTitle.Name = "gbMsgTitle";
this.gbMsgTitle.TabStop = false;
//
// ssMain
//
resources.ApplyResources(this.ssMain, "ssMain");
this.ssMain.ImageScalingSize = new System.Drawing.Size(20, 20);
this.ssMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolSslInboundInfo,
this.toolSslBlank1,
this.toolSslRoutingRule,
this.toolSslBlank2,
this.toolSslServerSpeed,
this.toolSslBlank4});
this.ssMain.Name = "ssMain";
this.ssMain.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.ssMain_ItemClicked);
//
// toolSslInboundInfo
//
resources.ApplyResources(this.toolSslInboundInfo, "toolSslInboundInfo");
this.toolSslInboundInfo.Name = "toolSslInboundInfo";
//
// toolSslBlank1
//
resources.ApplyResources(this.toolSslBlank1, "toolSslBlank1");
this.toolSslBlank1.Name = "toolSslBlank1";
this.toolSslBlank1.Spring = true;
//
// toolSslRoutingRule
//
resources.ApplyResources(this.toolSslRoutingRule, "toolSslRoutingRule");
this.toolSslRoutingRule.Name = "toolSslRoutingRule";
//
// toolSslBlank2
//
resources.ApplyResources(this.toolSslBlank2, "toolSslBlank2");
this.toolSslBlank2.Name = "toolSslBlank2";
this.toolSslBlank2.Spring = true;
//
// toolSslServerSpeed
//
resources.ApplyResources(this.toolSslServerSpeed, "toolSslServerSpeed");
this.toolSslServerSpeed.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolSslServerSpeed.Name = "toolSslServerSpeed";
//
// toolSslBlank4
//
resources.ApplyResources(this.toolSslBlank4, "toolSslBlank4");
this.toolSslBlank4.Name = "toolSslBlank4";
//
// MainMsgControl
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.gbMsgTitle);
this.Name = "MainMsgControl";
this.Load += new System.EventHandler(this.MainMsgControl_Load);
this.cmsMsgBox.ResumeLayout(false);
this.gbMsgTitle.ResumeLayout(false);
this.gbMsgTitle.PerformLayout();
this.ssMain.ResumeLayout(false);
this.ssMain.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TextBox txtMsgBox;
private System.Windows.Forms.ContextMenuStrip cmsMsgBox;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxSelectAll;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxCopy;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxCopyAll;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxClear;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxAddRoutingRule;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxFilter;
private System.Windows.Forms.GroupBox gbMsgTitle;
private System.Windows.Forms.StatusStrip ssMain;
private System.Windows.Forms.ToolStripStatusLabel toolSslInboundInfo;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank1;
private System.Windows.Forms.ToolStripStatusLabel toolSslRoutingRule;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank2;
private System.Windows.Forms.ToolStripStatusLabel toolSslServerSpeed;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank4;
}
}

View File

@@ -0,0 +1,210 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Forms
{
public partial class MainMsgControl : UserControl
{
private string _msgFilter = string.Empty;
delegate void AppendTextDelegate(string text);
public MainMsgControl()
{
InitializeComponent();
}
private void MainMsgControl_Load(object sender, EventArgs e)
{
_msgFilter = Utils.RegReadValue(Global.MyRegPath, Utils.MainMsgFilterKey, "");
if (!Utils.IsNullOrEmpty(_msgFilter))
{
gbMsgTitle.Text = string.Format(ResUI.MsgInformationTitle, _msgFilter);
}
}
#region
public void AppendText(string text)
{
if (txtMsgBox.InvokeRequired)
{
Invoke(new AppendTextDelegate(AppendText), text);
}
else
{
if (!Utils.IsNullOrEmpty(_msgFilter))
{
if (!Regex.IsMatch(text, _msgFilter))
{
return;
}
}
//this.txtMsgBox.AppendText(text);
ShowMsg(text);
}
}
/// <summary>
/// 提示信息
/// </summary>
/// <param name="msg"></param>
private void ShowMsg(string msg)
{
if (txtMsgBox.Lines.Length > 999)
{
ClearMsg();
}
txtMsgBox.AppendText(msg);
if (!msg.EndsWith(Environment.NewLine))
{
txtMsgBox.AppendText(Environment.NewLine);
}
}
/// <summary>
/// 清除信息
/// </summary>
public void ClearMsg()
{
txtMsgBox.Invoke((Action)delegate
{
txtMsgBox.Clear();
});
}
public void DisplayToolStatus(Config config)
{
StringBuilder sb = new StringBuilder();
sb.Append($"{ResUI.LabLocal}:");
sb.Append($"[{Global.InboundSocks}:{config.GetLocalPort(Global.InboundSocks)}]");
sb.Append(" | ");
if (config.sysProxyType == ESysProxyType.ForcedChange)
{
sb.Append($"[{Global.InboundHttp}({ResUI.SystemProxy}):{config.GetLocalPort(Global.InboundHttp)}]");
}
else
{
sb.Append($"[{Global.InboundHttp}:{config.GetLocalPort(Global.InboundHttp)}]");
}
if (config.inbound[0].allowLANConn)
{
sb.Append($" {ResUI.LabLAN}:");
sb.Append($"[{Global.InboundSocks}:{config.GetLocalPort(Global.InboundSocks2)}]");
sb.Append(" | ");
sb.Append($"[{Global.InboundHttp}:{config.GetLocalPort(Global.InboundHttp2)}]");
}
SetToolSslInfo("inbound", sb.ToString());
}
public void SetToolSslInfo(string type, string value)
{
switch (type)
{
case "speed":
toolSslServerSpeed.Text = value;
break;
case "inbound":
toolSslInboundInfo.Text = value;
break;
case "routing":
toolSslRoutingRule.Text = value;
break;
}
}
public void ScrollToCaret()
{
txtMsgBox.ScrollToCaret();
}
#endregion
#region MsgBoxMenu
private void menuMsgBoxSelectAll_Click(object sender, EventArgs e)
{
txtMsgBox.Focus();
txtMsgBox.SelectAll();
}
private void menuMsgBoxCopy_Click(object sender, EventArgs e)
{
var data = txtMsgBox.SelectedText.TrimEx();
Utils.SetClipboardData(data);
}
private void menuMsgBoxCopyAll_Click(object sender, EventArgs e)
{
var data = txtMsgBox.Text;
Utils.SetClipboardData(data);
}
private void menuMsgBoxClear_Click(object sender, EventArgs e)
{
txtMsgBox.Clear();
}
private void menuMsgBoxAddRoutingRule_Click(object sender, EventArgs e)
{
menuMsgBoxCopy_Click(null, null);
var fm = new RoutingSettingForm();
fm.ShowDialog();
}
private void txtMsgBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control)
{
switch (e.KeyCode)
{
case Keys.A:
menuMsgBoxSelectAll_Click(null, null);
break;
case Keys.C:
menuMsgBoxCopy_Click(null, null);
break;
case Keys.V:
menuMsgBoxAddRoutingRule_Click(null, null);
break;
}
}
}
private void menuMsgBoxFilter_Click(object sender, EventArgs e)
{
var fm = new MsgFilterSetForm();
fm.MsgFilter = _msgFilter;
fm.ShowDefFilter = true;
if (fm.ShowDialog() == DialogResult.OK)
{
_msgFilter = fm.MsgFilter;
gbMsgTitle.Text = string.Format(ResUI.MsgInformationTitle, _msgFilter);
Utils.RegWriteValue(Global.MyRegPath, Utils.MainMsgFilterKey, _msgFilter);
}
}
private void ssMain_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
if (!Utils.IsNullOrEmpty(e.ClickedItem.Text))
{
Utils.SetClipboardData(e.ClickedItem.Text);
}
}
#endregion
}
}

View File

@@ -0,0 +1,384 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="&gt;&gt;toolSslRoutingRule.Name" xml:space="preserve">
<value>toolSslRoutingRule</value>
</data>
<data name="&gt;&gt;gbMsgTitle.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="menuMsgBoxSelectAll.Text" xml:space="preserve">
<value>Select All (Ctrl+A)</value>
</data>
<data name="&gt;&gt;ssMain.Name" xml:space="preserve">
<value>ssMain</value>
</data>
<data name="&gt;&gt;menuMsgBoxSelectAll.Name" xml:space="preserve">
<value>menuMsgBoxSelectAll</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="toolSslServerSpeed.AutoSize" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;menuMsgBoxClear.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslServerSpeed.Name" xml:space="preserve">
<value>toolSslServerSpeed</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="menuMsgBoxSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="&gt;&gt;menuMsgBoxCopyAll.Name" xml:space="preserve">
<value>menuMsgBoxCopyAll</value>
</data>
<data name="txtMsgBox.MaxLength" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;gbMsgTitle.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="ssMain.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 221</value>
</data>
<data name="menuMsgBoxAddRoutingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="menuMsgBoxFilter.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="&gt;&gt;toolSslBlank2.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslBlank1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslInboundInfo.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="toolSslRoutingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 17</value>
</data>
<data name="toolSslInboundInfo.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 17</value>
</data>
<data name="&gt;&gt;toolSslInboundInfo.Name" xml:space="preserve">
<value>toolSslInboundInfo</value>
</data>
<data name="&gt;&gt;txtMsgBox.Name" xml:space="preserve">
<value>txtMsgBox</value>
</data>
<data name="toolSslBlank4.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 17</value>
</data>
<data name="&gt;&gt;menuMsgBoxFilter.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="toolSslBlank1.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
</data>
<data name="menuMsgBoxCopy.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="&gt;&gt;ssMain.Parent" xml:space="preserve">
<value>gbMsgTitle</value>
</data>
<data name="menuMsgBoxCopyAll.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="&gt;&gt;toolSslRoutingRule.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="menuMsgBoxAddRoutingRule.Text" xml:space="preserve">
<value>Add Routing Rule (Ctrl+V)</value>
</data>
<data name="toolSslServerSpeed.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleRight</value>
</data>
<data name="toolSslServerSpeed.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
</data>
<data name="gbMsgTitle.Size" type="System.Drawing.Size, System.Drawing">
<value>696, 246</value>
</data>
<data name="toolSslInboundInfo.Text" xml:space="preserve">
<value>InboundInfo</value>
</data>
<data name="&gt;&gt;menuMsgBoxAddRoutingRule.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMsgBoxClear.Name" xml:space="preserve">
<value>menuMsgBoxClear</value>
</data>
<data name="txtMsgBox.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="gbMsgTitle.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;menuMsgBoxCopy.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="txtMsgBox.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="&gt;&gt;toolSslBlank4.Name" xml:space="preserve">
<value>toolSslBlank4</value>
</data>
<data name="&gt;&gt;txtMsgBox.Parent" xml:space="preserve">
<value>gbMsgTitle</value>
</data>
<data name="gbMsgTitle.Text" xml:space="preserve">
<value>Informations</value>
</data>
<data name="ssMain.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="toolSslBlank2.Size" type="System.Drawing.Size, System.Drawing">
<value>172, 17</value>
</data>
<data name="txtMsgBox.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="menuMsgBoxClear.Text" xml:space="preserve">
<value>Clear All</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="txtMsgBox.ScrollBars" type="System.Windows.Forms.ScrollBars, System.Windows.Forms">
<value>Vertical</value>
</data>
<data name="&gt;&gt;gbMsgTitle.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="ssMain.Size" type="System.Drawing.Size, System.Drawing">
<value>690, 22</value>
</data>
<data name="&gt;&gt;cmsMsgBox.Name" xml:space="preserve">
<value>cmsMsgBox</value>
</data>
<data name="txtMsgBox.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="&gt;&gt;cmsMsgBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;ssMain.Type" xml:space="preserve">
<value>System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="gbMsgTitle.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="txtMsgBox.Size" type="System.Drawing.Size, System.Drawing">
<value>690, 204</value>
</data>
<data name="menuMsgBoxClear.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="toolSslBlank1.Size" type="System.Drawing.Size, System.Drawing">
<value>172, 17</value>
</data>
<data name="&gt;&gt;toolSslBlank4.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>MainMsgControl</value>
</data>
<data name="gbMsgTitle.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>696, 246</value>
</data>
<data name="&gt;&gt;toolSslBlank1.Name" xml:space="preserve">
<value>toolSslBlank1</value>
</data>
<data name="toolSslServerSpeed.RightToLeft" type="System.Windows.Forms.RightToLeft, System.Windows.Forms">
<value>No</value>
</data>
<data name="menuMsgBoxCopyAll.Text" xml:space="preserve">
<value>Copy All</value>
</data>
<data name="toolSslServerSpeed.Size" type="System.Drawing.Size, System.Drawing">
<value>250, 17</value>
</data>
<data name="ssMain.Text" xml:space="preserve">
<value>statusStrip1</value>
</data>
<data name="&gt;&gt;menuMsgBoxAddRoutingRule.Name" xml:space="preserve">
<value>menuMsgBoxAddRoutingRule</value>
</data>
<data name="&gt;&gt;toolSslBlank2.Name" xml:space="preserve">
<value>toolSslBlank2</value>
</data>
<data name="menuMsgBoxFilter.Text" xml:space="preserve">
<value>Set message filters</value>
</data>
<data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>SPEED Disabled</value>
</data>
<data name="&gt;&gt;txtMsgBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;gbMsgTitle.Name" xml:space="preserve">
<value>gbMsgTitle</value>
</data>
<data name="&gt;&gt;menuMsgBoxFilter.Name" xml:space="preserve">
<value>menuMsgBoxFilter</value>
</data>
<data name="&gt;&gt;ssMain.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMsgBoxSelectAll.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMsgBoxCopy.Name" xml:space="preserve">
<value>menuMsgBoxCopy</value>
</data>
<data name="&gt;&gt;txtMsgBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslServerSpeed.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="menuMsgBoxCopy.Text" xml:space="preserve">
<value>Copy (Ctrl+C)</value>
</data>
<data name="cmsMsgBox.Size" type="System.Drawing.Size, System.Drawing">
<value>228, 136</value>
</data>
<data name="&gt;&gt;menuMsgBoxCopyAll.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<metadata name="ssMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>131, 18</value>
</metadata>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="cmsMsgBox.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,172 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="menuMsgBoxSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxSelectAll.Text" xml:space="preserve">
<value>全选 (Ctrl+A)</value>
</data>
<data name="menuMsgBoxCopy.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxCopy.Text" xml:space="preserve">
<value>复制 (Ctrl+C)</value>
</data>
<data name="menuMsgBoxCopyAll.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxCopyAll.Text" xml:space="preserve">
<value>复制所有</value>
</data>
<data name="menuMsgBoxClear.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxClear.Text" xml:space="preserve">
<value>清除所有</value>
</data>
<data name="menuMsgBoxAddRoutingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxAddRoutingRule.Text" xml:space="preserve">
<value>快速添加路由规则 (Ctrl+V)</value>
</data>
<data name="menuMsgBoxFilter.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxFilter.Text" xml:space="preserve">
<value>设置信息过滤器</value>
</data>
<data name="cmsMsgBox.Size" type="System.Drawing.Size, System.Drawing">
<value>222, 136</value>
</data>
<data name="toolSslBlank1.Size" type="System.Drawing.Size, System.Drawing">
<value>157, 17</value>
</data>
<data name="toolSslBlank2.Size" type="System.Drawing.Size, System.Drawing">
<value>157, 17</value>
</data>
<data name="gbMsgTitle.Text" xml:space="preserve">
<value>信息</value>
</data>
<data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>网速显示未启用</value>
</data>
</root>

View File

@@ -30,12 +30,13 @@
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MsgFilterSetForm)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MsgFilterSetForm));
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnFilderProxy = new System.Windows.Forms.Button();
this.btnFilterDirect = new System.Windows.Forms.Button();
this.txtMsgFilter = new System.Windows.Forms.TextBox(); this.txtMsgFilter = new System.Windows.Forms.TextBox();
this.panel2 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel();
this.btnClose = new System.Windows.Forms.Button(); this.btnClose = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button(); this.btnOK = new System.Windows.Forms.Button();
this.btnFilterDirect = new System.Windows.Forms.Button(); this.btnClear = new System.Windows.Forms.Button();
this.btnFilderProxy = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
@@ -49,6 +50,20 @@
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
// //
// btnFilderProxy
//
resources.ApplyResources(this.btnFilderProxy, "btnFilderProxy");
this.btnFilderProxy.Name = "btnFilderProxy";
this.btnFilderProxy.UseVisualStyleBackColor = true;
this.btnFilderProxy.Click += new System.EventHandler(this.btnFilderProxy_Click);
//
// btnFilterDirect
//
resources.ApplyResources(this.btnFilterDirect, "btnFilterDirect");
this.btnFilterDirect.Name = "btnFilterDirect";
this.btnFilterDirect.UseVisualStyleBackColor = true;
this.btnFilterDirect.Click += new System.EventHandler(this.btnFilterDirect_Click);
//
// txtMsgFilter // txtMsgFilter
// //
resources.ApplyResources(this.txtMsgFilter, "txtMsgFilter"); resources.ApplyResources(this.txtMsgFilter, "txtMsgFilter");
@@ -56,6 +71,7 @@
// //
// panel2 // panel2
// //
this.panel2.Controls.Add(this.btnClear);
this.panel2.Controls.Add(this.btnClose); this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK); this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2"); resources.ApplyResources(this.panel2, "panel2");
@@ -76,24 +92,18 @@
this.btnOK.UseVisualStyleBackColor = true; this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click); this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
// //
// btnFilterDirect // btnClear
// //
resources.ApplyResources(this.btnFilterDirect, "btnFilterDirect"); resources.ApplyResources(this.btnClear, "btnClear");
this.btnFilterDirect.Name = "btnFilterDirect"; this.btnClear.Name = "btnClear";
this.btnFilterDirect.UseVisualStyleBackColor = true; this.btnClear.UseVisualStyleBackColor = true;
this.btnFilterDirect.Click += new System.EventHandler(this.btnFilterDirect_Click); this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
//
// btnFilderProxy
//
resources.ApplyResources(this.btnFilderProxy, "btnFilderProxy");
this.btnFilderProxy.Name = "btnFilderProxy";
this.btnFilderProxy.UseVisualStyleBackColor = true;
this.btnFilderProxy.Click += new System.EventHandler(this.btnFilderProxy_Click);
// //
// MsgFilterSetForm // MsgFilterSetForm
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnClose;
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Controls.Add(this.panel2); this.Controls.Add(this.panel2);
this.Name = "MsgFilterSetForm"; this.Name = "MsgFilterSetForm";
@@ -114,5 +124,6 @@
private System.Windows.Forms.Button btnOK; private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnFilderProxy; private System.Windows.Forms.Button btnFilderProxy;
private System.Windows.Forms.Button btnFilterDirect; private System.Windows.Forms.Button btnFilterDirect;
private System.Windows.Forms.Button btnClear;
} }
} }

View File

@@ -13,6 +13,7 @@ namespace v2rayN.Forms
public partial class MsgFilterSetForm : BaseForm public partial class MsgFilterSetForm : BaseForm
{ {
public string MsgFilter { get; set; } public string MsgFilter { get; set; }
public bool ShowDefFilter { get; set; }
public MsgFilterSetForm() public MsgFilterSetForm()
{ {
@@ -22,17 +23,19 @@ namespace v2rayN.Forms
private void MsgFilterSetForm_Load(object sender, EventArgs e) private void MsgFilterSetForm_Load(object sender, EventArgs e)
{ {
txtMsgFilter.Text = MsgFilter; txtMsgFilter.Text = MsgFilter;
btnFilderProxy.Visible =
btnFilterDirect.Visible = ShowDefFilter;
} }
private void btnOK_Click(object sender, EventArgs e) private void btnOK_Click(object sender, EventArgs e)
{ {
MsgFilter = txtMsgFilter.Text; MsgFilter = txtMsgFilter.Text;
this.DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }
private void btnClose_Click(object sender, EventArgs e) private void btnClose_Click(object sender, EventArgs e)
{ {
this.DialogResult = DialogResult.Cancel; DialogResult = DialogResult.Cancel;
} }
private void btnFilderProxy_Click(object sender, EventArgs e) private void btnFilderProxy_Click(object sender, EventArgs e)
@@ -44,5 +47,11 @@ namespace v2rayN.Forms
{ {
txtMsgFilter.Text = "^(?!.*direct).*$"; txtMsgFilter.Text = "^(?!.*direct).*$";
} }
private void btnClear_Click(object sender, EventArgs e)
{
MsgFilter = string.Empty;
DialogResult = DialogResult.OK;
}
} }
} }

View File

@@ -117,14 +117,78 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="&gt;&gt;btnFilderProxy.Name" xml:space="preserve">
<value>btnFilderProxy</value>
</data>
<data name="&gt;&gt;btnFilderProxy.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnFilderProxy.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;btnFilderProxy.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnFilterDirect.Name" xml:space="preserve">
<value>btnFilterDirect</value>
</data>
<data name="&gt;&gt;btnFilterDirect.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnFilterDirect.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;btnFilterDirect.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;txtMsgFilter.Name" xml:space="preserve">
<value>txtMsgFilter</value>
</data>
<data name="&gt;&gt;txtMsgFilter.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtMsgFilter.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtMsgFilter.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>490, 76</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Filter</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnFilderProxy.Location" type="System.Drawing.Point, System.Drawing"> <data name="btnFilderProxy.Location" type="System.Drawing.Point, System.Drawing">
<value>157, 47</value> <value>157, 47</value>
</data> </data>
<data name="btnFilderProxy.Size" type="System.Drawing.Size, System.Drawing"> <data name="btnFilderProxy.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 23</value> <value>95, 23</value>
</data> </data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnFilderProxy.TabIndex" type="System.Int32, mscorlib"> <data name="btnFilderProxy.TabIndex" type="System.Int32, mscorlib">
<value>13</value> <value>13</value>
</data> </data>
@@ -143,7 +207,6 @@
<data name="&gt;&gt;btnFilderProxy.ZOrder" xml:space="preserve"> <data name="&gt;&gt;btnFilderProxy.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnFilterDirect.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="btnFilterDirect.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
@@ -192,81 +255,33 @@
<data name="&gt;&gt;txtMsgFilter.ZOrder" xml:space="preserve"> <data name="&gt;&gt;txtMsgFilter.ZOrder" xml:space="preserve">
<value>2</value> <value>2</value>
</data> </data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="btnClear.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>Fill</value> <value>NoControl</value>
</data> </data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing"> <data name="btnClear.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value> <value>211, 17</value>
</data> </data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing"> <data name="btnClear.Size" type="System.Drawing.Size, System.Drawing">
<value>490, 76</value> <value>75, 23</value>
</data> </data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib"> <data name="btnClear.TabIndex" type="System.Int32, mscorlib">
<value>8</value> <value>14</value>
</data> </data>
<data name="groupBox1.Text" xml:space="preserve"> <data name="btnClear.Text" xml:space="preserve">
<value>Filter</value> <value>Clear</value>
</data> </data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve"> <data name="&gt;&gt;btnClear.Name" xml:space="preserve">
<value>groupBox1</value> <value>btnClear</value>
</data> </data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve"> <data name="&gt;&gt;btnClear.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve"> <data name="&gt;&gt;btnClear.Parent" xml:space="preserve">
<value>panel2</value> <value>panel2</value>
</data> </data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve"> <data name="&gt;&gt;btnClear.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 76</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>490, 60</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>9</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
@@ -292,7 +307,7 @@
<value>panel2</value> <value>panel2</value>
</data> </data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve"> <data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value> <value>1</value>
</data> </data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
@@ -319,6 +334,30 @@
<value>panel2</value> <value>panel2</value>
</data> </data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve"> <data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 76</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>490, 60</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>9</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>1</value> <value>1</value>
</data> </data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

View File

@@ -135,4 +135,7 @@
<data name="btnFilterDirect.Text" xml:space="preserve"> <data name="btnFilterDirect.Text" xml:space="preserve">
<value>过滤Direct</value> <value>过滤Direct</value>
</data> </data>
<data name="btnClear.Text" xml:space="preserve">
<value>清空</value>
</data>
</root> </root>

View File

@@ -50,6 +50,8 @@
this.txtlocalPort = new System.Windows.Forms.TextBox(); this.txtlocalPort = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.tabPage2 = new System.Windows.Forms.TabPage(); this.tabPage2 = new System.Windows.Forms.TabPage();
this.cmbdomainStrategy4Freedom = new System.Windows.Forms.ComboBox();
this.label19 = new System.Windows.Forms.Label();
this.linkDnsObjectDoc = new System.Windows.Forms.LinkLabel(); this.linkDnsObjectDoc = new System.Windows.Forms.LinkLabel();
this.txtremoteDNS = new System.Windows.Forms.TextBox(); this.txtremoteDNS = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label(); this.label14 = new System.Windows.Forms.Label();
@@ -68,6 +70,11 @@
this.txtKcpmtu = new System.Windows.Forms.TextBox(); this.txtKcpmtu = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
this.tabPage7 = new System.Windows.Forms.TabPage(); this.tabPage7 = new System.Windows.Forms.TabPage();
this.numStatisticsFreshRate = new System.Windows.Forms.NumericUpDown();
this.txttrayMenuServersLimit = new System.Windows.Forms.TextBox();
this.label17 = new System.Windows.Forms.Label();
this.txtautoUpdateSubInterval = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.chkEnableSecurityProtocolTls13 = new System.Windows.Forms.CheckBox(); this.chkEnableSecurityProtocolTls13 = new System.Windows.Forms.CheckBox();
this.chkEnableAutoAdjustMainLvColWidth = new System.Windows.Forms.CheckBox(); this.chkEnableAutoAdjustMainLvColWidth = new System.Windows.Forms.CheckBox();
this.btnSetLoopback = new System.Windows.Forms.Button(); this.btnSetLoopback = new System.Windows.Forms.Button();
@@ -75,7 +82,6 @@
this.label15 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label();
this.chkIgnoreGeoUpdateCore = new System.Windows.Forms.CheckBox(); this.chkIgnoreGeoUpdateCore = new System.Windows.Forms.CheckBox();
this.chkKeepOlderDedupl = new System.Windows.Forms.CheckBox(); this.chkKeepOlderDedupl = new System.Windows.Forms.CheckBox();
this.cbFreshrate = new System.Windows.Forms.ComboBox();
this.lbFreshrate = new System.Windows.Forms.Label(); this.lbFreshrate = new System.Windows.Forms.Label();
this.chkEnableStatistics = new System.Windows.Forms.CheckBox(); this.chkEnableStatistics = new System.Windows.Forms.CheckBox();
this.chkAutoRun = new System.Windows.Forms.CheckBox(); this.chkAutoRun = new System.Windows.Forms.CheckBox();
@@ -94,18 +100,22 @@
this.labCoreType1 = new System.Windows.Forms.Label(); this.labCoreType1 = new System.Windows.Forms.Label();
this.tabPage3 = new System.Windows.Forms.TabPage(); this.tabPage3 = new System.Windows.Forms.TabPage();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label18 = new System.Windows.Forms.Label();
this.cmbSystemProxyAdvancedProtocol = new System.Windows.Forms.ComboBox();
this.label13 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label();
this.txtsystemProxyExceptions = new System.Windows.Forms.TextBox(); this.txtsystemProxyExceptions = new System.Windows.Forms.TextBox();
this.panel2 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel();
this.btnOK = new System.Windows.Forms.Button(); this.btnOK = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.chkEnableCheckPreReleaseUpdate = new System.Windows.Forms.CheckBox();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.tabPage2.SuspendLayout(); this.tabPage2.SuspendLayout();
this.tabPage6.SuspendLayout(); this.tabPage6.SuspendLayout();
this.tabPage7.SuspendLayout(); this.tabPage7.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numStatisticsFreshRate)).BeginInit();
this.tabPageCoreType.SuspendLayout(); this.tabPageCoreType.SuspendLayout();
this.tabPage3.SuspendLayout(); this.tabPage3.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
@@ -114,34 +124,33 @@
// //
// btnClose // btnClose
// //
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.Name = "btnClose"; this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true; this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click); this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
// //
// tabControl1 // tabControl1
// //
resources.ApplyResources(this.tabControl1, "tabControl1");
this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage6); this.tabControl1.Controls.Add(this.tabPage6);
this.tabControl1.Controls.Add(this.tabPage7); this.tabControl1.Controls.Add(this.tabPage7);
this.tabControl1.Controls.Add(this.tabPageCoreType); this.tabControl1.Controls.Add(this.tabPageCoreType);
this.tabControl1.Controls.Add(this.tabPage3); this.tabControl1.Controls.Add(this.tabPage3);
resources.ApplyResources(this.tabControl1, "tabControl1");
this.tabControl1.Name = "tabControl1"; this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0; this.tabControl1.SelectedIndex = 0;
// //
// tabPage1 // tabPage1
// //
resources.ApplyResources(this.tabPage1, "tabPage1");
this.tabPage1.Controls.Add(this.groupBox1); this.tabPage1.Controls.Add(this.groupBox1);
resources.ApplyResources(this.tabPage1, "tabPage1");
this.tabPage1.Name = "tabPage1"; this.tabPage1.Name = "tabPage1";
this.tabPage1.UseVisualStyleBackColor = true; this.tabPage1.UseVisualStyleBackColor = true;
// //
// groupBox1 // groupBox1
// //
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.label16); this.groupBox1.Controls.Add(this.label16);
this.groupBox1.Controls.Add(this.label4); this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.txtpass); this.groupBox1.Controls.Add(this.txtpass);
@@ -158,6 +167,7 @@
this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.txtlocalPort); this.groupBox1.Controls.Add(this.txtlocalPort);
this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.label2);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
// //
@@ -207,8 +217,8 @@
// //
// cmbprotocol // cmbprotocol
// //
resources.ApplyResources(this.cmbprotocol, "cmbprotocol");
this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
resources.ApplyResources(this.cmbprotocol, "cmbprotocol");
this.cmbprotocol.FormattingEnabled = true; this.cmbprotocol.FormattingEnabled = true;
this.cmbprotocol.Items.AddRange(new object[] { this.cmbprotocol.Items.AddRange(new object[] {
resources.GetString("cmbprotocol.Items"), resources.GetString("cmbprotocol.Items"),
@@ -234,7 +244,6 @@
// //
// cmbloglevel // cmbloglevel
// //
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
this.cmbloglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbloglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbloglevel.FormattingEnabled = true; this.cmbloglevel.FormattingEnabled = true;
this.cmbloglevel.Items.AddRange(new object[] { this.cmbloglevel.Items.AddRange(new object[] {
@@ -243,6 +252,7 @@
resources.GetString("cmbloglevel.Items2"), resources.GetString("cmbloglevel.Items2"),
resources.GetString("cmbloglevel.Items3"), resources.GetString("cmbloglevel.Items3"),
resources.GetString("cmbloglevel.Items4")}); resources.GetString("cmbloglevel.Items4")});
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
this.cmbloglevel.Name = "cmbloglevel"; this.cmbloglevel.Name = "cmbloglevel";
// //
// label5 // label5
@@ -262,13 +272,32 @@
// //
// tabPage2 // tabPage2
// //
resources.ApplyResources(this.tabPage2, "tabPage2"); this.tabPage2.Controls.Add(this.cmbdomainStrategy4Freedom);
this.tabPage2.Controls.Add(this.label19);
this.tabPage2.Controls.Add(this.linkDnsObjectDoc); this.tabPage2.Controls.Add(this.linkDnsObjectDoc);
this.tabPage2.Controls.Add(this.txtremoteDNS); this.tabPage2.Controls.Add(this.txtremoteDNS);
this.tabPage2.Controls.Add(this.label14); this.tabPage2.Controls.Add(this.label14);
resources.ApplyResources(this.tabPage2, "tabPage2");
this.tabPage2.Name = "tabPage2"; this.tabPage2.Name = "tabPage2";
this.tabPage2.UseVisualStyleBackColor = true; this.tabPage2.UseVisualStyleBackColor = true;
// //
// cmbdomainStrategy4Freedom
//
this.cmbdomainStrategy4Freedom.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbdomainStrategy4Freedom.FormattingEnabled = true;
this.cmbdomainStrategy4Freedom.Items.AddRange(new object[] {
resources.GetString("cmbdomainStrategy4Freedom.Items"),
resources.GetString("cmbdomainStrategy4Freedom.Items1"),
resources.GetString("cmbdomainStrategy4Freedom.Items2"),
resources.GetString("cmbdomainStrategy4Freedom.Items3")});
resources.ApplyResources(this.cmbdomainStrategy4Freedom, "cmbdomainStrategy4Freedom");
this.cmbdomainStrategy4Freedom.Name = "cmbdomainStrategy4Freedom";
//
// label19
//
resources.ApplyResources(this.label19, "label19");
this.label19.Name = "label19";
//
// linkDnsObjectDoc // linkDnsObjectDoc
// //
resources.ApplyResources(this.linkDnsObjectDoc, "linkDnsObjectDoc"); resources.ApplyResources(this.linkDnsObjectDoc, "linkDnsObjectDoc");
@@ -288,7 +317,6 @@
// //
// tabPage6 // tabPage6
// //
resources.ApplyResources(this.tabPage6, "tabPage6");
this.tabPage6.Controls.Add(this.chkKcpcongestion); this.tabPage6.Controls.Add(this.chkKcpcongestion);
this.tabPage6.Controls.Add(this.txtKcpwriteBufferSize); this.tabPage6.Controls.Add(this.txtKcpwriteBufferSize);
this.tabPage6.Controls.Add(this.label10); this.tabPage6.Controls.Add(this.label10);
@@ -302,6 +330,7 @@
this.tabPage6.Controls.Add(this.label7); this.tabPage6.Controls.Add(this.label7);
this.tabPage6.Controls.Add(this.txtKcpmtu); this.tabPage6.Controls.Add(this.txtKcpmtu);
this.tabPage6.Controls.Add(this.label6); this.tabPage6.Controls.Add(this.label6);
resources.ApplyResources(this.tabPage6, "tabPage6");
this.tabPage6.Name = "tabPage6"; this.tabPage6.Name = "tabPage6";
this.tabPage6.UseVisualStyleBackColor = true; this.tabPage6.UseVisualStyleBackColor = true;
// //
@@ -373,7 +402,12 @@
// //
// tabPage7 // tabPage7
// //
resources.ApplyResources(this.tabPage7, "tabPage7"); this.tabPage7.Controls.Add(this.chkEnableCheckPreReleaseUpdate);
this.tabPage7.Controls.Add(this.numStatisticsFreshRate);
this.tabPage7.Controls.Add(this.txttrayMenuServersLimit);
this.tabPage7.Controls.Add(this.label17);
this.tabPage7.Controls.Add(this.txtautoUpdateSubInterval);
this.tabPage7.Controls.Add(this.label3);
this.tabPage7.Controls.Add(this.chkEnableSecurityProtocolTls13); this.tabPage7.Controls.Add(this.chkEnableSecurityProtocolTls13);
this.tabPage7.Controls.Add(this.chkEnableAutoAdjustMainLvColWidth); this.tabPage7.Controls.Add(this.chkEnableAutoAdjustMainLvColWidth);
this.tabPage7.Controls.Add(this.btnSetLoopback); this.tabPage7.Controls.Add(this.btnSetLoopback);
@@ -381,13 +415,38 @@
this.tabPage7.Controls.Add(this.label15); this.tabPage7.Controls.Add(this.label15);
this.tabPage7.Controls.Add(this.chkIgnoreGeoUpdateCore); this.tabPage7.Controls.Add(this.chkIgnoreGeoUpdateCore);
this.tabPage7.Controls.Add(this.chkKeepOlderDedupl); this.tabPage7.Controls.Add(this.chkKeepOlderDedupl);
this.tabPage7.Controls.Add(this.cbFreshrate);
this.tabPage7.Controls.Add(this.lbFreshrate); this.tabPage7.Controls.Add(this.lbFreshrate);
this.tabPage7.Controls.Add(this.chkEnableStatistics); this.tabPage7.Controls.Add(this.chkEnableStatistics);
this.tabPage7.Controls.Add(this.chkAutoRun); this.tabPage7.Controls.Add(this.chkAutoRun);
resources.ApplyResources(this.tabPage7, "tabPage7");
this.tabPage7.Name = "tabPage7"; this.tabPage7.Name = "tabPage7";
this.tabPage7.UseVisualStyleBackColor = true; this.tabPage7.UseVisualStyleBackColor = true;
// //
// numStatisticsFreshRate
//
resources.ApplyResources(this.numStatisticsFreshRate, "numStatisticsFreshRate");
this.numStatisticsFreshRate.Name = "numStatisticsFreshRate";
//
// txttrayMenuServersLimit
//
resources.ApplyResources(this.txttrayMenuServersLimit, "txttrayMenuServersLimit");
this.txttrayMenuServersLimit.Name = "txttrayMenuServersLimit";
//
// label17
//
resources.ApplyResources(this.label17, "label17");
this.label17.Name = "label17";
//
// txtautoUpdateSubInterval
//
resources.ApplyResources(this.txtautoUpdateSubInterval, "txtautoUpdateSubInterval");
this.txtautoUpdateSubInterval.Name = "txtautoUpdateSubInterval";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// chkEnableSecurityProtocolTls13 // chkEnableSecurityProtocolTls13
// //
resources.ApplyResources(this.chkEnableSecurityProtocolTls13, "chkEnableSecurityProtocolTls13"); resources.ApplyResources(this.chkEnableSecurityProtocolTls13, "chkEnableSecurityProtocolTls13");
@@ -429,13 +488,6 @@
this.chkKeepOlderDedupl.Name = "chkKeepOlderDedupl"; this.chkKeepOlderDedupl.Name = "chkKeepOlderDedupl";
this.chkKeepOlderDedupl.UseVisualStyleBackColor = true; this.chkKeepOlderDedupl.UseVisualStyleBackColor = true;
// //
// cbFreshrate
//
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
this.cbFreshrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbFreshrate.FormattingEnabled = true;
this.cbFreshrate.Name = "cbFreshrate";
//
// lbFreshrate // lbFreshrate
// //
resources.ApplyResources(this.lbFreshrate, "lbFreshrate"); resources.ApplyResources(this.lbFreshrate, "lbFreshrate");
@@ -455,7 +507,6 @@
// //
// tabPageCoreType // tabPageCoreType
// //
resources.ApplyResources(this.tabPageCoreType, "tabPageCoreType");
this.tabPageCoreType.Controls.Add(this.cmbCoreType6); this.tabPageCoreType.Controls.Add(this.cmbCoreType6);
this.tabPageCoreType.Controls.Add(this.labCoreType6); this.tabPageCoreType.Controls.Add(this.labCoreType6);
this.tabPageCoreType.Controls.Add(this.cmbCoreType5); this.tabPageCoreType.Controls.Add(this.cmbCoreType5);
@@ -468,14 +519,15 @@
this.tabPageCoreType.Controls.Add(this.labCoreType2); this.tabPageCoreType.Controls.Add(this.labCoreType2);
this.tabPageCoreType.Controls.Add(this.cmbCoreType1); this.tabPageCoreType.Controls.Add(this.cmbCoreType1);
this.tabPageCoreType.Controls.Add(this.labCoreType1); this.tabPageCoreType.Controls.Add(this.labCoreType1);
resources.ApplyResources(this.tabPageCoreType, "tabPageCoreType");
this.tabPageCoreType.Name = "tabPageCoreType"; this.tabPageCoreType.Name = "tabPageCoreType";
this.tabPageCoreType.UseVisualStyleBackColor = true; this.tabPageCoreType.UseVisualStyleBackColor = true;
// //
// cmbCoreType6 // cmbCoreType6
// //
resources.ApplyResources(this.cmbCoreType6, "cmbCoreType6");
this.cmbCoreType6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType6.FormattingEnabled = true; this.cmbCoreType6.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType6, "cmbCoreType6");
this.cmbCoreType6.Name = "cmbCoreType6"; this.cmbCoreType6.Name = "cmbCoreType6";
// //
// labCoreType6 // labCoreType6
@@ -485,9 +537,9 @@
// //
// cmbCoreType5 // cmbCoreType5
// //
resources.ApplyResources(this.cmbCoreType5, "cmbCoreType5");
this.cmbCoreType5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType5.FormattingEnabled = true; this.cmbCoreType5.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType5, "cmbCoreType5");
this.cmbCoreType5.Name = "cmbCoreType5"; this.cmbCoreType5.Name = "cmbCoreType5";
// //
// labCoreType5 // labCoreType5
@@ -497,9 +549,9 @@
// //
// cmbCoreType4 // cmbCoreType4
// //
resources.ApplyResources(this.cmbCoreType4, "cmbCoreType4");
this.cmbCoreType4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType4.FormattingEnabled = true; this.cmbCoreType4.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType4, "cmbCoreType4");
this.cmbCoreType4.Name = "cmbCoreType4"; this.cmbCoreType4.Name = "cmbCoreType4";
// //
// labCoreType4 // labCoreType4
@@ -509,9 +561,9 @@
// //
// cmbCoreType3 // cmbCoreType3
// //
resources.ApplyResources(this.cmbCoreType3, "cmbCoreType3");
this.cmbCoreType3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType3.FormattingEnabled = true; this.cmbCoreType3.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType3, "cmbCoreType3");
this.cmbCoreType3.Name = "cmbCoreType3"; this.cmbCoreType3.Name = "cmbCoreType3";
// //
// labCoreType3 // labCoreType3
@@ -521,9 +573,9 @@
// //
// cmbCoreType2 // cmbCoreType2
// //
resources.ApplyResources(this.cmbCoreType2, "cmbCoreType2");
this.cmbCoreType2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType2.FormattingEnabled = true; this.cmbCoreType2.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType2, "cmbCoreType2");
this.cmbCoreType2.Name = "cmbCoreType2"; this.cmbCoreType2.Name = "cmbCoreType2";
// //
// labCoreType2 // labCoreType2
@@ -533,9 +585,9 @@
// //
// cmbCoreType1 // cmbCoreType1
// //
resources.ApplyResources(this.cmbCoreType1, "cmbCoreType1");
this.cmbCoreType1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType1.FormattingEnabled = true; this.cmbCoreType1.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType1, "cmbCoreType1");
this.cmbCoreType1.Name = "cmbCoreType1"; this.cmbCoreType1.Name = "cmbCoreType1";
// //
// labCoreType1 // labCoreType1
@@ -545,20 +597,33 @@
// //
// tabPage3 // tabPage3
// //
resources.ApplyResources(this.tabPage3, "tabPage3");
this.tabPage3.Controls.Add(this.groupBox2); this.tabPage3.Controls.Add(this.groupBox2);
resources.ApplyResources(this.tabPage3, "tabPage3");
this.tabPage3.Name = "tabPage3"; this.tabPage3.Name = "tabPage3";
this.tabPage3.UseVisualStyleBackColor = true; this.tabPage3.UseVisualStyleBackColor = true;
// //
// groupBox2 // groupBox2
// //
resources.ApplyResources(this.groupBox2, "groupBox2"); this.groupBox2.Controls.Add(this.label18);
this.groupBox2.Controls.Add(this.cmbSystemProxyAdvancedProtocol);
this.groupBox2.Controls.Add(this.label13); this.groupBox2.Controls.Add(this.label13);
this.groupBox2.Controls.Add(this.label12); this.groupBox2.Controls.Add(this.label12);
this.groupBox2.Controls.Add(this.txtsystemProxyExceptions); this.groupBox2.Controls.Add(this.txtsystemProxyExceptions);
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Name = "groupBox2"; this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false; this.groupBox2.TabStop = false;
// //
// label18
//
resources.ApplyResources(this.label18, "label18");
this.label18.Name = "label18";
//
// cmbSystemProxyAdvancedProtocol
//
this.cmbSystemProxyAdvancedProtocol.FormattingEnabled = true;
resources.ApplyResources(this.cmbSystemProxyAdvancedProtocol, "cmbSystemProxyAdvancedProtocol");
this.cmbSystemProxyAdvancedProtocol.Name = "cmbSystemProxyAdvancedProtocol";
//
// label13 // label13
// //
resources.ApplyResources(this.label13, "label13"); resources.ApplyResources(this.label13, "label13");
@@ -576,9 +641,9 @@
// //
// panel2 // panel2
// //
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.btnClose); this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK); this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2"; this.panel2.Name = "panel2";
// //
// btnOK // btnOK
@@ -593,6 +658,12 @@
resources.ApplyResources(this.panel1, "panel1"); resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1"; this.panel1.Name = "panel1";
// //
// chkEnableCheckPreReleaseUpdate
//
resources.ApplyResources(this.chkEnableCheckPreReleaseUpdate, "chkEnableCheckPreReleaseUpdate");
this.chkEnableCheckPreReleaseUpdate.Name = "chkEnableCheckPreReleaseUpdate";
this.chkEnableCheckPreReleaseUpdate.UseVisualStyleBackColor = true;
//
// OptionSettingForm // OptionSettingForm
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
@@ -614,6 +685,7 @@
this.tabPage6.PerformLayout(); this.tabPage6.PerformLayout();
this.tabPage7.ResumeLayout(false); this.tabPage7.ResumeLayout(false);
this.tabPage7.PerformLayout(); this.tabPage7.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numStatisticsFreshRate)).EndInit();
this.tabPageCoreType.ResumeLayout(false); this.tabPageCoreType.ResumeLayout(false);
this.tabPageCoreType.PerformLayout(); this.tabPageCoreType.PerformLayout();
this.tabPage3.ResumeLayout(false); this.tabPage3.ResumeLayout(false);
@@ -661,7 +733,6 @@
private System.Windows.Forms.CheckBox chkAllowLANConn; private System.Windows.Forms.CheckBox chkAllowLANConn;
private System.Windows.Forms.CheckBox chksniffingEnabled; private System.Windows.Forms.CheckBox chksniffingEnabled;
private System.Windows.Forms.CheckBox chkEnableStatistics; private System.Windows.Forms.CheckBox chkEnableStatistics;
private System.Windows.Forms.ComboBox cbFreshrate;
private System.Windows.Forms.Label lbFreshrate; private System.Windows.Forms.Label lbFreshrate;
private System.Windows.Forms.CheckBox chkKeepOlderDedupl; private System.Windows.Forms.CheckBox chkKeepOlderDedupl;
private System.Windows.Forms.CheckBox chkdefAllowInsecure; private System.Windows.Forms.CheckBox chkdefAllowInsecure;
@@ -697,5 +768,15 @@
private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtpass; private System.Windows.Forms.TextBox txtpass;
private System.Windows.Forms.TextBox txtuser; private System.Windows.Forms.TextBox txtuser;
private System.Windows.Forms.TextBox txtautoUpdateSubInterval;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txttrayMenuServersLimit;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.ComboBox cmbSystemProxyAdvancedProtocol;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.NumericUpDown numStatisticsFreshRate;
private System.Windows.Forms.ComboBox cmbdomainStrategy4Freedom;
private System.Windows.Forms.Label label19;
private System.Windows.Forms.CheckBox chkEnableCheckPreReleaseUpdate;
} }
} }

View File

@@ -18,6 +18,10 @@ namespace v2rayN.Forms
private void OptionSettingForm_Load(object sender, EventArgs e) private void OptionSettingForm_Load(object sender, EventArgs e)
{ {
cmbSystemProxyAdvancedProtocol.Items.AddRange(Global.IEProxyProtocols.ToArray());
cmbdomainStrategy4Freedom.Items.Clear();
cmbdomainStrategy4Freedom.Items.AddRange(Global.domainStrategy4Freedoms.ToArray());
InitBase(); InitBase();
InitKCP(); InitKCP();
@@ -54,10 +58,13 @@ namespace v2rayN.Forms
//remoteDNS //remoteDNS
txtremoteDNS.Text = config.remoteDNS; txtremoteDNS.Text = config.remoteDNS;
cmbdomainStrategy4Freedom.Text = config.domainStrategy4Freedom;
chkdefAllowInsecure.Checked = config.defAllowInsecure; chkdefAllowInsecure.Checked = config.defAllowInsecure;
txtsystemProxyExceptions.Text = config.systemProxyExceptions; txtsystemProxyExceptions.Text = config.systemProxyExceptions;
cmbSystemProxyAdvancedProtocol.Text = config.systemProxyAdvancedProtocol;
} }
@@ -84,36 +91,17 @@ namespace v2rayN.Forms
chkAutoRun.Checked = Utils.IsAutoRun(); chkAutoRun.Checked = Utils.IsAutoRun();
chkEnableStatistics.Checked = config.enableStatistics; chkEnableStatistics.Checked = config.enableStatistics;
numStatisticsFreshRate.Value = config.statisticsFreshRate;
chkKeepOlderDedupl.Checked = config.keepOlderDedupl; chkKeepOlderDedupl.Checked = config.keepOlderDedupl;
ComboItem[] cbSource = new ComboItem[]
{
new ComboItem{ID = (int)Global.StatisticsFreshRate.quick, Text = ResUI.QuickFresh},
new ComboItem{ID = (int)Global.StatisticsFreshRate.medium, Text = ResUI.MediumFresh},
new ComboItem{ID = (int)Global.StatisticsFreshRate.slow, Text = ResUI.SlowFresh},
};
cbFreshrate.DataSource = cbSource;
cbFreshrate.DisplayMember = "Text";
cbFreshrate.ValueMember = "ID";
switch (config.statisticsFreshRate)
{
case (int)Global.StatisticsFreshRate.quick:
cbFreshrate.SelectedItem = cbSource[0];
break;
case (int)Global.StatisticsFreshRate.medium:
cbFreshrate.SelectedItem = cbSource[1];
break;
case (int)Global.StatisticsFreshRate.slow:
cbFreshrate.SelectedItem = cbSource[2];
break;
}
chkIgnoreGeoUpdateCore.Checked = config.ignoreGeoUpdateCore; chkIgnoreGeoUpdateCore.Checked = config.ignoreGeoUpdateCore;
txtautoUpdateInterval.Text = config.autoUpdateInterval.ToString();
chkEnableAutoAdjustMainLvColWidth.Checked = config.uiItem.enableAutoAdjustMainLvColWidth; chkEnableAutoAdjustMainLvColWidth.Checked = config.uiItem.enableAutoAdjustMainLvColWidth;
chkEnableSecurityProtocolTls13.Checked = config.enableSecurityProtocolTls13; chkEnableSecurityProtocolTls13.Checked = config.enableSecurityProtocolTls13;
txtautoUpdateInterval.Text = config.autoUpdateInterval.ToString();
txtautoUpdateSubInterval.Text = config.autoUpdateSubInterval.ToString();
chkEnableCheckPreReleaseUpdate.Checked = config.checkPreReleaseUpdate;
txttrayMenuServersLimit.Text = config.trayMenuServersLimit.ToString();
} }
private void InitCoreType() private void InitCoreType()
@@ -170,7 +158,7 @@ namespace v2rayN.Forms
if (ConfigHandler.SaveConfig(ref config) == 0) if (ConfigHandler.SaveConfig(ref config) == 0)
{ {
this.DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }
else else
{ {
@@ -245,11 +233,14 @@ namespace v2rayN.Forms
//remoteDNS //remoteDNS
config.remoteDNS = txtremoteDNS.Text.TrimEx(); config.remoteDNS = txtremoteDNS.Text.TrimEx();
config.domainStrategy4Freedom = cmbdomainStrategy4Freedom.Text;
config.defAllowInsecure = chkdefAllowInsecure.Checked; config.defAllowInsecure = chkdefAllowInsecure.Checked;
config.systemProxyExceptions = txtsystemProxyExceptions.Text.TrimEx(); config.systemProxyExceptions = txtsystemProxyExceptions.Text.TrimEx();
config.systemProxyAdvancedProtocol = cmbSystemProxyAdvancedProtocol.Text.TrimEx();
return 0; return 0;
} }
@@ -300,14 +291,22 @@ namespace v2rayN.Forms
bool lastEnableStatistics = config.enableStatistics; bool lastEnableStatistics = config.enableStatistics;
config.enableStatistics = chkEnableStatistics.Checked; config.enableStatistics = chkEnableStatistics.Checked;
config.statisticsFreshRate = (int)cbFreshrate.SelectedValue; config.statisticsFreshRate = Convert.ToInt32(numStatisticsFreshRate.Value);
if (config.statisticsFreshRate > 100 || config.statisticsFreshRate < 1)
{
config.statisticsFreshRate = 1;
}
config.keepOlderDedupl = chkKeepOlderDedupl.Checked; config.keepOlderDedupl = chkKeepOlderDedupl.Checked;
config.ignoreGeoUpdateCore = chkIgnoreGeoUpdateCore.Checked; config.ignoreGeoUpdateCore = chkIgnoreGeoUpdateCore.Checked;
config.autoUpdateInterval = Utils.ToInt(txtautoUpdateInterval.Text);
config.uiItem.enableAutoAdjustMainLvColWidth = chkEnableAutoAdjustMainLvColWidth.Checked; config.uiItem.enableAutoAdjustMainLvColWidth = chkEnableAutoAdjustMainLvColWidth.Checked;
config.enableSecurityProtocolTls13 = chkEnableSecurityProtocolTls13.Checked; config.enableSecurityProtocolTls13 = chkEnableSecurityProtocolTls13.Checked;
config.autoUpdateInterval = Utils.ToInt(txtautoUpdateInterval.Text);
config.autoUpdateSubInterval = Utils.ToInt(txtautoUpdateSubInterval.Text);
config.checkPreReleaseUpdate = chkEnableCheckPreReleaseUpdate.Checked;
config.trayMenuServersLimit = Utils.ToInt(txttrayMenuServersLimit.Text);
return 0; return 0;
} }
@@ -324,7 +323,7 @@ namespace v2rayN.Forms
private void btnClose_Click(object sender, EventArgs e) private void btnClose_Click(object sender, EventArgs e)
{ {
this.DialogResult = DialogResult.Cancel; DialogResult = DialogResult.Cancel;
} }
@@ -337,6 +336,6 @@ namespace v2rayN.Forms
{ {
Process.Start(Utils.GetPath("EnableLoopback.exe")); Process.Start(Utils.GetPath("EnableLoopback.exe"));
} }
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -226,12 +226,21 @@
<data name="tabPage2.Text" xml:space="preserve"> <data name="tabPage2.Text" xml:space="preserve">
<value> Core:DNS设置 </value> <value> Core:DNS设置 </value>
</data> </data>
<data name="cmbdomainStrategy4Freedom.Location" type="System.Drawing.Point, System.Drawing">
<value>223, 413</value>
</data>
<data name="label19.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 417</value>
</data>
<data name="linkDnsObjectDoc.Size" type="System.Drawing.Size, System.Drawing"> <data name="linkDnsObjectDoc.Size" type="System.Drawing.Size, System.Drawing">
<value>161, 12</value> <value>161, 12</value>
</data> </data>
<data name="linkDnsObjectDoc.Text" xml:space="preserve"> <data name="linkDnsObjectDoc.Text" xml:space="preserve">
<value>支持填写DnsObject,JSON格式</value> <value>支持填写DnsObject,JSON格式</value>
</data> </data>
<data name="txtremoteDNS.Size" type="System.Drawing.Size, System.Drawing">
<value>638, 366</value>
</data>
<data name="label14.Size" type="System.Drawing.Size, System.Drawing"> <data name="label14.Size" type="System.Drawing.Size, System.Drawing">
<value>191, 12</value> <value>191, 12</value>
</data> </data>
@@ -250,6 +259,27 @@
<data name="tabPage7.Text" xml:space="preserve"> <data name="tabPage7.Text" xml:space="preserve">
<value> v2rayN设置 </value> <value> v2rayN设置 </value>
</data> </data>
<data name="numStatisticsFreshRate.Location" type="System.Drawing.Point, System.Drawing">
<value>472, 37</value>
</data>
<data name="txttrayMenuServersLimit.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 211</value>
</data>
<data name="label17.Size" type="System.Drawing.Size, System.Drawing">
<value>185, 12</value>
</data>
<data name="label17.Text" xml:space="preserve">
<value>托盘右键菜单服务器展示数量限制</value>
</data>
<data name="txtautoUpdateSubInterval.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 184</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>173, 12</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>自动更新订阅的间隔(单位小时)</value>
</data>
<data name="chkEnableSecurityProtocolTls13.Text" xml:space="preserve"> <data name="chkEnableSecurityProtocolTls13.Text" xml:space="preserve">
<value>启用安全协议TLS v1.3 (订阅/检查更新/测速)</value> <value>启用安全协议TLS v1.3 (订阅/检查更新/测速)</value>
</data> </data>
@@ -263,13 +293,13 @@
<value>解除Windows10 UWP应用回环代理限制</value> <value>解除Windows10 UWP应用回环代理限制</value>
</data> </data>
<data name="txtautoUpdateInterval.Location" type="System.Drawing.Point, System.Drawing"> <data name="txtautoUpdateInterval.Location" type="System.Drawing.Point, System.Drawing">
<value>274, 134</value> <value>248, 157</value>
</data> </data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing"> <data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 12</value> <value>191, 12</value>
</data> </data>
<data name="label15.Text" xml:space="preserve"> <data name="label15.Text" xml:space="preserve">
<value>自动更新订阅和Geo文件的间隔(单位小时)</value> <value>自动更新Geo文件的间隔(单位小时)</value>
</data> </data>
<data name="chkIgnoreGeoUpdateCore.Size" type="System.Drawing.Size, System.Drawing"> <data name="chkIgnoreGeoUpdateCore.Size" type="System.Drawing.Size, System.Drawing">
<value>150, 16</value> <value>150, 16</value>
@@ -283,17 +313,20 @@
<data name="chkKeepOlderDedupl.Text" xml:space="preserve"> <data name="chkKeepOlderDedupl.Text" xml:space="preserve">
<value>去重时保留序号较小的项</value> <value>去重时保留序号较小的项</value>
</data> </data>
<data name="lbFreshrate.Location" type="System.Drawing.Point, System.Drawing">
<value>339, 41</value>
</data>
<data name="lbFreshrate.Size" type="System.Drawing.Size, System.Drawing"> <data name="lbFreshrate.Size" type="System.Drawing.Size, System.Drawing">
<value>77, 12</value> <value>125, 12</value>
</data> </data>
<data name="lbFreshrate.Text" xml:space="preserve"> <data name="lbFreshrate.Text" xml:space="preserve">
<value>统计刷新频率</value> <value>统计刷新频率(单位秒)</value>
</data> </data>
<data name="chkEnableStatistics.Size" type="System.Drawing.Size, System.Drawing"> <data name="chkEnableStatistics.Size" type="System.Drawing.Size, System.Drawing">
<value>372, 16</value> <value>300, 16</value>
</data> </data>
<data name="chkEnableStatistics.Text" xml:space="preserve"> <data name="chkEnableStatistics.Text" xml:space="preserve">
<value>启用统计(实时网速显示和使用流量显示,需要重启v2rayN客户端)</value> <value>启用统计(实时网速显示和使用流量显示,需要重启)</value>
</data> </data>
<data name="chkAutoRun.Size" type="System.Drawing.Size, System.Drawing"> <data name="chkAutoRun.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 16</value> <value>180, 16</value>
@@ -319,6 +352,12 @@
<data name="groupBox2.Text" xml:space="preserve"> <data name="groupBox2.Text" xml:space="preserve">
<value>例外</value> <value>例外</value>
</data> </data>
<data name="label18.Size" type="System.Drawing.Size, System.Drawing">
<value>173, 12</value>
</data>
<data name="label18.Text" xml:space="preserve">
<value>高级代理设置, 协议选择(可选)</value>
</data>
<data name="label13.Size" type="System.Drawing.Size, System.Drawing"> <data name="label13.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value> <value>95, 12</value>
</data> </data>
@@ -349,4 +388,7 @@
<data name="$this.Text" xml:space="preserve"> <data name="$this.Text" xml:space="preserve">
<value>参数设置</value> <value>参数设置</value>
</data> </data>
<data name="chkEnableCheckPreReleaseUpdate.Text" xml:space="preserve">
<value>检查Pre-Release更新(请谨慎启用)</value>
</data>
</root> </root>

View File

@@ -31,6 +31,7 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RoutingRuleSettingDetailsForm)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RoutingRuleSettingDetailsForm));
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel(); this.panel3 = new System.Windows.Forms.Panel();
this.linkRuleobjectDoc = new System.Windows.Forms.LinkLabel();
this.chkEnabled = new System.Windows.Forms.CheckBox(); this.chkEnabled = new System.Windows.Forms.CheckBox();
this.clbInboundTag = new System.Windows.Forms.CheckedListBox(); this.clbInboundTag = new System.Windows.Forms.CheckedListBox();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
@@ -42,6 +43,7 @@
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.cmbOutboundTag = new System.Windows.Forms.ComboBox(); this.cmbOutboundTag = new System.Windows.Forms.ComboBox();
this.panel4 = new System.Windows.Forms.Panel(); this.panel4 = new System.Windows.Forms.Panel();
this.chkAutoSort = new System.Windows.Forms.CheckBox();
this.btnClose = new System.Windows.Forms.Button(); this.btnClose = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button(); this.btnOK = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel();
@@ -64,6 +66,7 @@
// panel3 // panel3
// //
resources.ApplyResources(this.panel3, "panel3"); resources.ApplyResources(this.panel3, "panel3");
this.panel3.Controls.Add(this.linkRuleobjectDoc);
this.panel3.Controls.Add(this.chkEnabled); this.panel3.Controls.Add(this.chkEnabled);
this.panel3.Controls.Add(this.clbInboundTag); this.panel3.Controls.Add(this.clbInboundTag);
this.panel3.Controls.Add(this.label2); this.panel3.Controls.Add(this.label2);
@@ -76,6 +79,13 @@
this.panel3.Controls.Add(this.cmbOutboundTag); this.panel3.Controls.Add(this.cmbOutboundTag);
this.panel3.Name = "panel3"; this.panel3.Name = "panel3";
// //
// linkRuleobjectDoc
//
resources.ApplyResources(this.linkRuleobjectDoc, "linkRuleobjectDoc");
this.linkRuleobjectDoc.Name = "linkRuleobjectDoc";
this.linkRuleobjectDoc.TabStop = true;
this.linkRuleobjectDoc.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkRuleobjectDoc_LinkClicked);
//
// chkEnabled // chkEnabled
// //
resources.ApplyResources(this.chkEnabled, "chkEnabled"); resources.ApplyResources(this.chkEnabled, "chkEnabled");
@@ -89,7 +99,9 @@
this.clbInboundTag.FormattingEnabled = true; this.clbInboundTag.FormattingEnabled = true;
this.clbInboundTag.Items.AddRange(new object[] { this.clbInboundTag.Items.AddRange(new object[] {
resources.GetString("clbInboundTag.Items"), resources.GetString("clbInboundTag.Items"),
resources.GetString("clbInboundTag.Items1")}); resources.GetString("clbInboundTag.Items1"),
resources.GetString("clbInboundTag.Items2"),
resources.GetString("clbInboundTag.Items3")});
this.clbInboundTag.MultiColumn = true; this.clbInboundTag.MultiColumn = true;
this.clbInboundTag.Name = "clbInboundTag"; this.clbInboundTag.Name = "clbInboundTag";
// //
@@ -150,10 +162,17 @@
// panel4 // panel4
// //
resources.ApplyResources(this.panel4, "panel4"); resources.ApplyResources(this.panel4, "panel4");
this.panel4.Controls.Add(this.chkAutoSort);
this.panel4.Controls.Add(this.btnClose); this.panel4.Controls.Add(this.btnClose);
this.panel4.Controls.Add(this.btnOK); this.panel4.Controls.Add(this.btnOK);
this.panel4.Name = "panel4"; this.panel4.Name = "panel4";
// //
// chkAutoSort
//
resources.ApplyResources(this.chkAutoSort, "chkAutoSort");
this.chkAutoSort.Name = "chkAutoSort";
this.chkAutoSort.UseVisualStyleBackColor = true;
//
// btnClose // btnClose
// //
resources.ApplyResources(this.btnClose, "btnClose"); resources.ApplyResources(this.btnClose, "btnClose");
@@ -214,6 +233,7 @@
this.panel3.ResumeLayout(false); this.panel3.ResumeLayout(false);
this.panel3.PerformLayout(); this.panel3.PerformLayout();
this.panel4.ResumeLayout(false); this.panel4.ResumeLayout(false);
this.panel4.PerformLayout();
this.panel2.ResumeLayout(false); this.panel2.ResumeLayout(false);
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout(); this.groupBox2.PerformLayout();
@@ -245,5 +265,7 @@
private System.Windows.Forms.CheckedListBox clbInboundTag; private System.Windows.Forms.CheckedListBox clbInboundTag;
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private System.Windows.Forms.CheckBox chkEnabled; private System.Windows.Forms.CheckBox chkEnabled;
private System.Windows.Forms.CheckBox chkAutoSort;
private System.Windows.Forms.LinkLabel linkRuleobjectDoc;
} }
} }

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Forms; using System.Windows.Forms;
using v2rayN.Base; using v2rayN.Base;
using v2rayN.Handler; using v2rayN.Handler;
@@ -48,8 +49,16 @@ namespace v2rayN.Forms
} }
rulesItem.inboundTag = inboundTag; rulesItem.inboundTag = inboundTag;
rulesItem.outboundTag = cmbOutboundTag.Text; rulesItem.outboundTag = cmbOutboundTag.Text;
rulesItem.domain = Utils.String2ListSorted(txtDomain.Text); if (chkAutoSort.Checked)
rulesItem.ip = Utils.String2ListSorted(txtIP.Text); {
rulesItem.domain = Utils.String2ListSorted(txtDomain.Text);
rulesItem.ip = Utils.String2ListSorted(txtIP.Text);
}
else
{
rulesItem.domain = Utils.String2List(txtDomain.Text);
rulesItem.ip = Utils.String2List(txtIP.Text);
}
var protocol = new List<string>(); var protocol = new List<string>();
for (int i = 0; i < clbProtocol.Items.Count; i++) for (int i = 0; i < clbProtocol.Items.Count; i++)
@@ -107,34 +116,33 @@ namespace v2rayN.Forms
private void btnOK_Click(object sender, EventArgs e) private void btnOK_Click(object sender, EventArgs e)
{ {
EndBindingData(); EndBindingData();
var hasRule = false;
if (rulesItem.domain != null && rulesItem.domain.Count > 0) bool hasRule =
{ rulesItem.domain != null
hasRule = true; && rulesItem.domain.Count > 0
} || rulesItem.ip != null
if (rulesItem.ip != null && rulesItem.ip.Count > 0) && rulesItem.ip.Count > 0
{ || rulesItem.protocol != null
hasRule = true; && rulesItem.protocol.Count > 0
} || !Utils.IsNullOrEmpty(rulesItem.port);
if (rulesItem.protocol != null && rulesItem.protocol.Count > 0)
{
hasRule = true;
}
if (!Utils.IsNullOrEmpty(rulesItem.port))
{
hasRule = true;
}
if (!hasRule) if (!hasRule)
{ {
UI.ShowWarning(string.Format(ResUI.RoutingRuleDetailRequiredTips, "Port/Protocol/Domain/IP")); UI.ShowWarning(string.Format(ResUI.RoutingRuleDetailRequiredTips, "Port/Protocol/Domain/IP"));
return; return;
} }
this.DialogResult = DialogResult.OK;
DialogResult = DialogResult.OK;
} }
private void btnClose_Click(object sender, EventArgs e) private void btnClose_Click(object sender, EventArgs e)
{ {
this.DialogResult = DialogResult.Cancel; DialogResult = DialogResult.Cancel;
}
private void linkRuleobjectDoc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start("https://www.v2fly.org/config/routing.html#ruleobject");
} }
} }
} }

View File

@@ -117,9 +117,12 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="label3.Size" type="System.Drawing.Size, System.Drawing"> <data name="chkAutoSort.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>53, 12</value> <value>NoControl</value>
</data>
<data name="&gt;&gt;linkRuleobjectDoc.ZOrder" xml:space="preserve">
<value>0</value>
</data> </data>
<data name="&gt;&gt;clbInboundTag.Type" xml:space="preserve"> <data name="&gt;&gt;clbInboundTag.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
@@ -128,11 +131,15 @@
<data name="label4.TabIndex" type="System.Int32, mscorlib"> <data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>32</value> <value>32</value>
</data> </data>
<data name="&gt;&gt;linkRuleobjectDoc.Type" xml:space="preserve">
<value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="clbProtocol.Size" type="System.Drawing.Size, System.Drawing"> <data name="clbProtocol.Size" type="System.Drawing.Size, System.Drawing">
<value>245, 20</value> <value>245, 20</value>
</data> </data>
<data name="clbProtocol.ColumnWidth" type="System.Int32, mscorlib"> <data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>80</value> <value>53, 12</value>
</data> </data>
<data name="cmbOutboundTag.TabIndex" type="System.Int32, mscorlib"> <data name="cmbOutboundTag.TabIndex" type="System.Int32, mscorlib">
<value>31</value> <value>31</value>
@@ -140,7 +147,6 @@
<data name="cmbOutboundTag.Items" xml:space="preserve"> <data name="cmbOutboundTag.Items" xml:space="preserve">
<value>proxy</value> <value>proxy</value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="$this.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms"> <data name="$this.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value> <value>4, 4, 4, 4</value>
</data> </data>
@@ -156,14 +162,11 @@
<data name="&gt;&gt;clbProtocol.Name" xml:space="preserve"> <data name="&gt;&gt;clbProtocol.Name" xml:space="preserve">
<value>clbProtocol</value> <value>clbProtocol</value>
</data> </data>
<data name="label3.Text" xml:space="preserve">
<value>Protocol</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve"> <data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;labRoutingTips.ZOrder" xml:space="preserve"> <data name="&gt;&gt;labRoutingTips.ZOrder" xml:space="preserve">
<value>7</value> <value>8</value>
</data> </data>
<data name="label1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="label1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
@@ -175,7 +178,7 @@
<value>True</value> <value>True</value>
</data> </data>
<data name="&gt;&gt;clbProtocol.ZOrder" xml:space="preserve"> <data name="&gt;&gt;clbProtocol.ZOrder" xml:space="preserve">
<value>3</value> <value>4</value>
</data> </data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Left</value> <value>Left</value>
@@ -193,11 +196,14 @@
<value>29, 12</value> <value>29, 12</value>
</data> </data>
<data name="&gt;&gt;clbInboundTag.ZOrder" xml:space="preserve"> <data name="&gt;&gt;clbInboundTag.ZOrder" xml:space="preserve">
<value>1</value> <value>2</value>
</data> </data>
<data name="clbInboundTag.Items1" xml:space="preserve"> <data name="clbInboundTag.Items1" xml:space="preserve">
<value>http</value> <value>http</value>
</data> </data>
<data name="chkAutoSort.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;groupBox2.Parent" xml:space="preserve"> <data name="&gt;&gt;groupBox2.Parent" xml:space="preserve">
<value>panel2</value> <value>panel2</value>
</data> </data>
@@ -214,7 +220,7 @@
<value>System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>6</value> <value>7</value>
</data> </data>
<data name="groupBox2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="groupBox2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value> <value>Fill</value>
@@ -234,8 +240,11 @@
<data name="panel4.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="panel4.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value> <value>Bottom</value>
</data> </data>
<data name="linkRuleobjectDoc.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve"> <data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value> <value>1</value>
</data> </data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve"> <data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
@@ -246,8 +255,11 @@
<data name="&gt;&gt;panel3.Parent" xml:space="preserve"> <data name="&gt;&gt;panel3.Parent" xml:space="preserve">
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;chkAutoSort.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing"> <data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
<value>598, 16</value> <value>575, 16</value>
</data> </data>
<data name="&gt;&gt;txtDomain.Parent" xml:space="preserve"> <data name="&gt;&gt;txtDomain.Parent" xml:space="preserve">
<value>groupBox1</value> <value>groupBox1</value>
@@ -255,11 +267,8 @@
<data name="labRoutingTips.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="labRoutingTips.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;txtPort.ZOrder" xml:space="preserve"> <data name="&gt;&gt;txtPort.ZOrder" xml:space="preserve">
<value>5</value> <value>6</value>
</data> </data>
<data name="&gt;&gt;label1.Name" xml:space="preserve"> <data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value> <value>label1</value>
@@ -267,11 +276,11 @@
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing"> <data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 395</value> <value>742, 395</value>
</data> </data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing"> <data name="label3.Text" xml:space="preserve">
<value>0, 0</value> <value>Protocol</value>
</data> </data>
<data name="&gt;&gt;cmbOutboundTag.ZOrder" xml:space="preserve"> <data name="&gt;&gt;cmbOutboundTag.ZOrder" xml:space="preserve">
<value>9</value> <value>10</value>
</data> </data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib"> <data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
@@ -291,8 +300,8 @@
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve"> <data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel4</value> <value>panel4</value>
</data> </data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib"> <data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>5</value> <value>3</value>
</data> </data>
<data name="clbProtocol.Items2" xml:space="preserve"> <data name="clbProtocol.Items2" xml:space="preserve">
<value>bittorrent</value> <value>bittorrent</value>
@@ -300,18 +309,21 @@
<data name="&gt;&gt;btnOK.Type" xml:space="preserve"> <data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="clbInboundTag.Items" xml:space="preserve"> <data name="linkRuleobjectDoc.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>socks</value> <value>NoControl</value>
</data> </data>
<data name="&gt;&gt;chkEnabled.Parent" xml:space="preserve"> <data name="chkAutoSort.Size" type="System.Drawing.Size, System.Drawing">
<value>panel3</value> <value>270, 16</value>
</data> </data>
<data name="labRoutingTips.Location" type="System.Drawing.Point, System.Drawing"> <data name="labRoutingTips.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 82</value> <value>144, 86</value>
</data> </data>
<data name="txtIP.TabIndex" type="System.Int32, mscorlib"> <data name="txtIP.TabIndex" type="System.Int32, mscorlib">
<value>25</value> <value>25</value>
</data> </data>
<data name="&gt;&gt;panel3.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="clbInboundTag.Location" type="System.Drawing.Point, System.Drawing"> <data name="clbInboundTag.Location" type="System.Drawing.Point, System.Drawing">
<value>347, 16</value> <value>347, 16</value>
</data> </data>
@@ -321,6 +333,15 @@
<data name="&gt;&gt;labRoutingTips.Parent" xml:space="preserve"> <data name="&gt;&gt;labRoutingTips.Parent" xml:space="preserve">
<value>panel3</value> <value>panel3</value>
</data> </data>
<data name="chkAutoSort.TabIndex" type="System.Int32, mscorlib">
<value>41</value>
</data>
<data name="clbProtocol.ColumnWidth" type="System.Int32, mscorlib">
<value>80</value>
</data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing"> <data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 20</value> <value>19, 20</value>
</data> </data>
@@ -333,11 +354,14 @@
<data name="clbProtocol.TabIndex" type="System.Int32, mscorlib"> <data name="clbProtocol.TabIndex" type="System.Int32, mscorlib">
<value>39</value> <value>39</value>
</data> </data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve"> <data name="txtDomain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>groupBox1</value> <value>Fill</value>
</data>
<data name="linkRuleobjectDoc.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data> </data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve"> <data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value> <value>2</value>
</data> </data>
<data name="&gt;&gt;$this.Name" xml:space="preserve"> <data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>RoutingRuleSettingDetailsForm</value> <value>RoutingRuleSettingDetailsForm</value>
@@ -357,8 +381,11 @@
<data name="&gt;&gt;groupBox2.Name" xml:space="preserve"> <data name="&gt;&gt;groupBox2.Name" xml:space="preserve">
<value>groupBox2</value> <value>groupBox2</value>
</data> </data>
<data name="linkRuleobjectDoc.Text" xml:space="preserve">
<value>Ruleobject Doc</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>8</value> <value>9</value>
</data> </data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve"> <data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>1</value> <value>1</value>
@@ -369,6 +396,9 @@
<data name="&gt;&gt;cmbOutboundTag.Parent" xml:space="preserve"> <data name="&gt;&gt;cmbOutboundTag.Parent" xml:space="preserve">
<value>panel3</value> <value>panel3</value>
</data> </data>
<data name="clbInboundTag.Items3" xml:space="preserve">
<value>http2</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Type" xml:space="preserve"> <data name="&gt;&gt;cmbOutboundTag.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
@@ -384,8 +414,8 @@
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="panel3.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="clbInboundTag.Items2" xml:space="preserve">
<value>Top</value> <value>socks2</value>
</data> </data>
<data name="&gt;&gt;panel1.Parent" xml:space="preserve"> <data name="&gt;&gt;panel1.Parent" xml:space="preserve">
<value>$this</value> <value>$this</value>
@@ -396,9 +426,15 @@
<data name="&gt;&gt;txtIP.Parent" xml:space="preserve"> <data name="&gt;&gt;txtIP.Parent" xml:space="preserve">
<value>groupBox2</value> <value>groupBox2</value>
</data> </data>
<data name="&gt;&gt;chkEnabled.Name" xml:space="preserve">
<value>chkEnabled</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve"> <data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>panel3</value> <value>panel3</value>
</data> </data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;label4.Parent" xml:space="preserve"> <data name="&gt;&gt;label4.Parent" xml:space="preserve">
<value>panel3</value> <value>panel3</value>
</data> </data>
@@ -426,6 +462,9 @@
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing"> <data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value> <value>0, 0</value>
</data> </data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="txtDomain.TabIndex" type="System.Int32, mscorlib"> <data name="txtDomain.TabIndex" type="System.Int32, mscorlib">
<value>24</value> <value>24</value>
</data> </data>
@@ -441,9 +480,6 @@
<data name="btnOK.Text" xml:space="preserve"> <data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value> <value>&amp;OK</value>
</data> </data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;labRoutingTips.Type" xml:space="preserve"> <data name="&gt;&gt;labRoutingTips.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
@@ -468,6 +504,9 @@
<data name="clbProtocol.Location" type="System.Drawing.Point, System.Drawing"> <data name="clbProtocol.Location" type="System.Drawing.Point, System.Drawing">
<value>347, 43</value> <value>347, 43</value>
</data> </data>
<data name="&gt;&gt;chkEnabled.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;txtDomain.ZOrder" xml:space="preserve"> <data name="&gt;&gt;txtDomain.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
@@ -480,12 +519,18 @@
<data name="&gt;&gt;btnOK.Name" xml:space="preserve"> <data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value> <value>btnOK</value>
</data> </data>
<data name="linkRuleobjectDoc.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 0</value>
</data>
<data name="&gt;&gt;panel3.ZOrder" xml:space="preserve"> <data name="&gt;&gt;panel3.ZOrder" xml:space="preserve">
<value>2</value> <value>2</value>
</data> </data>
<data name="txtPort.Size" type="System.Drawing.Size, System.Drawing"> <data name="txtPort.Size" type="System.Drawing.Size, System.Drawing">
<value>119, 21</value> <value>119, 21</value>
</data> </data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="groupBox2.TabIndex" type="System.Int32, mscorlib"> <data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
<value>4</value> <value>4</value>
</data> </data>
@@ -501,6 +546,9 @@
<data name="&gt;&gt;txtIP.ZOrder" xml:space="preserve"> <data name="&gt;&gt;txtIP.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<data name="linkRuleobjectDoc.TabIndex" type="System.Int32, mscorlib">
<value>43</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve"> <data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>panel3</value> <value>panel3</value>
</data> </data>
@@ -516,8 +564,8 @@
<data name="label2.Text" xml:space="preserve"> <data name="label2.Text" xml:space="preserve">
<value>inboundTag</value> <value>inboundTag</value>
</data> </data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="&gt;&gt;chkAutoSort.Type" xml:space="preserve">
<value>Top</value> <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="panel4.Size" type="System.Drawing.Size, System.Drawing"> <data name="panel4.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 60</value> <value>742, 60</value>
@@ -525,6 +573,9 @@
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing"> <data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 121</value> <value>0, 121</value>
</data> </data>
<data name="&gt;&gt;chkAutoSort.Name" xml:space="preserve">
<value>chkAutoSort</value>
</data>
<data name="&gt;&gt;panel4.Parent" xml:space="preserve"> <data name="&gt;&gt;panel4.Parent" xml:space="preserve">
<value>$this</value> <value>$this</value>
</data> </data>
@@ -532,7 +583,13 @@
<value>*Set the rules, separated by commas (,); The comma in the regular is replaced by &lt;COMMA&gt;</value> <value>*Set the rules, separated by commas (,); The comma in the regular is replaced by &lt;COMMA&gt;</value>
</data> </data>
<data name="clbInboundTag.Size" type="System.Drawing.Size, System.Drawing"> <data name="clbInboundTag.Size" type="System.Drawing.Size, System.Drawing">
<value>245, 20</value> <value>345, 20</value>
</data>
<data name="&gt;&gt;linkRuleobjectDoc.Name" xml:space="preserve">
<value>linkRuleobjectDoc</value>
</data>
<data name="clbInboundTag.Items" xml:space="preserve">
<value>socks</value>
</data> </data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing"> <data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value> <value>65, 12</value>
@@ -553,10 +610,10 @@
<value>6, 12</value> <value>6, 12</value>
</data> </data>
<data name="&gt;&gt;chkEnabled.ZOrder" xml:space="preserve"> <data name="&gt;&gt;chkEnabled.ZOrder" xml:space="preserve">
<value>0</value> <value>1</value>
</data> </data>
<data name="chkEnabled.Location" type="System.Drawing.Point, System.Drawing"> <data name="chkEnabled.Location" type="System.Drawing.Point, System.Drawing">
<value>617, 19</value> <value>632, 45</value>
</data> </data>
<data name="panel3.Location" type="System.Drawing.Point, System.Drawing"> <data name="panel3.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 10</value> <value>0, 10</value>
@@ -567,6 +624,9 @@
<data name="&gt;&gt;txtDomain.Type" xml:space="preserve"> <data name="&gt;&gt;txtDomain.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>274, 20</value>
</data>
<data name="chkEnabled.AutoSize" type="System.Boolean, mscorlib"> <data name="chkEnabled.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
@@ -588,14 +648,14 @@
<data name="&gt;&gt;cmbOutboundTag.Name" xml:space="preserve"> <data name="&gt;&gt;cmbOutboundTag.Name" xml:space="preserve">
<value>cmbOutboundTag</value> <value>cmbOutboundTag</value>
</data> </data>
<data name="&gt;&gt;chkEnabled.Name" xml:space="preserve"> <data name="chkAutoSort.Text" xml:space="preserve">
<value>chkEnabled</value> <value>Domain and ip are auto sorted when saving</value>
</data> </data>
<data name="txtDomain.Multiline" type="System.Boolean, mscorlib"> <data name="txtDomain.Multiline" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing"> <data name="linkRuleobjectDoc.Location" type="System.Drawing.Point, System.Drawing">
<value>274, 20</value> <value>19, 86</value>
</data> </data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
@@ -612,6 +672,9 @@
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing"> <data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>392, 395</value> <value>392, 395</value>
</data> </data>
<data name="chkAutoSort.Location" type="System.Drawing.Point, System.Drawing">
<value>41, 18</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing"> <data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value> <value>75, 23</value>
</data> </data>
@@ -619,7 +682,10 @@
<value>clbInboundTag</value> <value>clbInboundTag</value>
</data> </data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>4</value> <value>5</value>
</data>
<data name="panel3.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data> </data>
<data name="btnClose.Text" xml:space="preserve"> <data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value> <value>&amp;Cancel</value>
@@ -648,8 +714,8 @@
<data name="&gt;&gt;clbInboundTag.Parent" xml:space="preserve"> <data name="&gt;&gt;clbInboundTag.Parent" xml:space="preserve">
<value>panel3</value> <value>panel3</value>
</data> </data>
<data name="&gt;&gt;panel3.Type" xml:space="preserve"> <data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>75, 23</value>
</data> </data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve"> <data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
@@ -663,18 +729,21 @@
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing"> <data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>350, 395</value> <value>350, 395</value>
</data> </data>
<data name="&gt;&gt;chkAutoSort.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="&gt;&gt;clbProtocol.Parent" xml:space="preserve"> <data name="&gt;&gt;clbProtocol.Parent" xml:space="preserve">
<value>panel3</value> <value>panel3</value>
</data> </data>
<data name="groupBox1.Text" xml:space="preserve"> <data name="groupBox1.Text" xml:space="preserve">
<value>Domain</value> <value>Domain</value>
</data> </data>
<data name="txtDomain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing"> <data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>504, 15</value> <value>504, 15</value>
</data> </data>
<data name="&gt;&gt;linkRuleobjectDoc.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="cmbOutboundTag.Location" type="System.Drawing.Point, System.Drawing"> <data name="cmbOutboundTag.Location" type="System.Drawing.Point, System.Drawing">
<value>107, 16</value> <value>107, 16</value>
</data> </data>

View File

@@ -118,14 +118,20 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="linkRuleobjectDoc.Size" type="System.Drawing.Size, System.Drawing">
<value>101, 12</value>
</data>
<data name="linkRuleobjectDoc.Text" xml:space="preserve">
<value>规则详细说明文档</value>
</data>
<data name="chkEnabled.Location" type="System.Drawing.Point, System.Drawing"> <data name="chkEnabled.Location" type="System.Drawing.Point, System.Drawing">
<value>670, 18</value> <value>670, 48</value>
</data> </data>
<data name="clbInboundTag.Location" type="System.Drawing.Point, System.Drawing"> <data name="clbInboundTag.Location" type="System.Drawing.Point, System.Drawing">
<value>372, 16</value> <value>372, 16</value>
</data> </data>
<data name="clbInboundTag.Size" type="System.Drawing.Size, System.Drawing"> <data name="clbInboundTag.Size" type="System.Drawing.Size, System.Drawing">
<value>272, 20</value> <value>347, 20</value>
</data> </data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing"> <data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>279, 20</value> <value>279, 20</value>
@@ -154,6 +160,12 @@
<data name="cmbOutboundTag.Location" type="System.Drawing.Point, System.Drawing"> <data name="cmbOutboundTag.Location" type="System.Drawing.Point, System.Drawing">
<value>120, 16</value> <value>120, 16</value>
</data> </data>
<data name="chkAutoSort.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 16</value>
</data>
<data name="chkAutoSort.Text" xml:space="preserve">
<value>保存时Domain和IP自动排序</value>
</data>
<data name="btnClose.Text" xml:space="preserve"> <data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value> <value>取消(&amp;C)</value>
</data> </data>

View File

@@ -15,9 +15,9 @@ namespace v2rayN.Forms
{ {
get; set; get; set;
} }
protected RoutingItem routingItem = null; protected RoutingItem routingItem;
private List<int> lvSelecteds = new List<int>(); private readonly List<int> lvSelecteds = new List<int>();
public RoutingRuleSettingForm() public RoutingRuleSettingForm()
{ {
InitializeComponent(); InitializeComponent();
@@ -25,14 +25,7 @@ namespace v2rayN.Forms
private void RoutingRuleSettingForm_Load(object sender, EventArgs e) private void RoutingRuleSettingForm_Load(object sender, EventArgs e)
{ {
if (EditIndex >= 0) routingItem = EditIndex >= 0 ? config.routings[EditIndex] : new RoutingItem();
{
routingItem = config.routings[EditIndex];
}
else
{
routingItem = new RoutingItem();
}
if (routingItem.rules == null) if (routingItem.rules == null)
{ {
routingItem.rules = new List<RulesItem>(); routingItem.rules = new List<RulesItem>();
@@ -86,10 +79,8 @@ namespace v2rayN.Forms
lvRoutings.BeginUpdate(); lvRoutings.BeginUpdate();
lvRoutings.Items.Clear(); lvRoutings.Items.Clear();
for (int k = 0; k < routingItem.rules.Count; k++) foreach (var item in routingItem.rules)
{ {
var item = routingItem.rules[k];
ListViewItem lvItem = new ListViewItem(""); ListViewItem lvItem = new ListViewItem("");
Utils.AddSubItem(lvItem, "outboundTag", item.outboundTag); Utils.AddSubItem(lvItem, "outboundTag", item.outboundTag);
Utils.AddSubItem(lvItem, "port", item.port); Utils.AddSubItem(lvItem, "port", item.port);
@@ -112,7 +103,7 @@ namespace v2rayN.Forms
if (ConfigHandler.AddRoutingItem(ref config, routingItem, EditIndex) == 0) if (ConfigHandler.AddRoutingItem(ref config, routingItem, EditIndex) == 0)
{ {
this.DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }
else else
{ {
@@ -122,7 +113,7 @@ namespace v2rayN.Forms
private void btnClose_Click(object sender, EventArgs e) private void btnClose_Click(object sender, EventArgs e)
{ {
this.DialogResult = DialogResult.Cancel; DialogResult = DialogResult.Cancel;
} }
private void btnBrowse_Click(object sender, EventArgs e) private void btnBrowse_Click(object sender, EventArgs e)
{ {

View File

@@ -45,6 +45,7 @@
this.menuRemove = new System.Windows.Forms.ToolStripMenuItem(); this.menuRemove = new System.Windows.Forms.ToolStripMenuItem();
this.menuSelectAll = new System.Windows.Forms.ToolStripMenuItem(); this.menuSelectAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuSetDefaultRouting = new System.Windows.Forms.ToolStripMenuItem(); this.menuSetDefaultRouting = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.menuImportAdvancedRules = new System.Windows.Forms.ToolStripMenuItem(); this.menuImportAdvancedRules = new System.Windows.Forms.ToolStripMenuItem();
this.MenuItemAdvanced = new System.Windows.Forms.ToolStripMenuItem(); this.MenuItemAdvanced = new System.Windows.Forms.ToolStripMenuItem();
this.menuServer = new System.Windows.Forms.MenuStrip(); this.menuServer = new System.Windows.Forms.MenuStrip();
@@ -71,7 +72,6 @@
this.txtBlockDomain = new System.Windows.Forms.TextBox(); this.txtBlockDomain = new System.Windows.Forms.TextBox();
this.tabPageRuleList = new System.Windows.Forms.TabPage(); this.tabPageRuleList = new System.Windows.Forms.TabPage();
this.lvRoutings = new v2rayN.Base.ListViewFlickerFree(); this.lvRoutings = new v2rayN.Base.ListViewFlickerFree();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.cmsLv.SuspendLayout(); this.cmsLv.SuspendLayout();
@@ -135,9 +135,6 @@
// //
this.cmbdomainMatcher.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbdomainMatcher.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbdomainMatcher.FormattingEnabled = true; this.cmbdomainMatcher.FormattingEnabled = true;
this.cmbdomainMatcher.Items.AddRange(new object[] {
resources.GetString("cmbdomainMatcher.Items"),
resources.GetString("cmbdomainMatcher.Items1")});
resources.ApplyResources(this.cmbdomainMatcher, "cmbdomainMatcher"); resources.ApplyResources(this.cmbdomainMatcher, "cmbdomainMatcher");
this.cmbdomainMatcher.Name = "cmbdomainMatcher"; this.cmbdomainMatcher.Name = "cmbdomainMatcher";
// //
@@ -209,6 +206,11 @@
resources.ApplyResources(this.menuSetDefaultRouting, "menuSetDefaultRouting"); resources.ApplyResources(this.menuSetDefaultRouting, "menuSetDefaultRouting");
this.menuSetDefaultRouting.Click += new System.EventHandler(this.menuSetDefaultRouting_Click); this.menuSetDefaultRouting.Click += new System.EventHandler(this.menuSetDefaultRouting_Click);
// //
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
//
// menuImportAdvancedRules // menuImportAdvancedRules
// //
this.menuImportAdvancedRules.Name = "menuImportAdvancedRules"; this.menuImportAdvancedRules.Name = "menuImportAdvancedRules";
@@ -390,11 +392,6 @@
this.lvRoutings.View = System.Windows.Forms.View.Details; this.lvRoutings.View = System.Windows.Forms.View.Details;
this.lvRoutings.DoubleClick += new System.EventHandler(this.lvRoutings_DoubleClick); this.lvRoutings.DoubleClick += new System.EventHandler(this.lvRoutings_DoubleClick);
// //
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
//
// RoutingSettingForm // RoutingSettingForm
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");

View File

@@ -10,8 +10,8 @@ namespace v2rayN.Forms
{ {
public partial class RoutingSettingForm : BaseForm public partial class RoutingSettingForm : BaseForm
{ {
private List<int> lvSelecteds = new List<int>(); private readonly List<int> _lvSelecteds = new List<int>();
private RoutingItem lockedItem; private RoutingItem _lockedItem;
public RoutingSettingForm() public RoutingSettingForm()
{ {
InitializeComponent(); InitializeComponent();
@@ -20,6 +20,7 @@ namespace v2rayN.Forms
private void RoutingSettingForm_Load(object sender, EventArgs e) private void RoutingSettingForm_Load(object sender, EventArgs e)
{ {
ConfigHandler.InitBuiltinRouting(ref config); ConfigHandler.InitBuiltinRouting(ref config);
cmbdomainMatcher.Items.AddRange(Global.domainMatchers.ToArray());
cmbdomainStrategy.Text = config.domainStrategy; cmbdomainStrategy.Text = config.domainStrategy;
chkenableRoutingAdvanced.Checked = config.enableRoutingAdvanced; chkenableRoutingAdvanced.Checked = config.enableRoutingAdvanced;
@@ -58,7 +59,7 @@ namespace v2rayN.Forms
if (ConfigHandler.SaveRouting(ref config) == 0) if (ConfigHandler.SaveRouting(ref config) == 0)
{ {
this.DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }
else else
{ {
@@ -68,7 +69,7 @@ namespace v2rayN.Forms
private void btnClose_Click(object sender, EventArgs e) private void btnClose_Click(object sender, EventArgs e)
{ {
this.DialogResult = DialogResult.Cancel; DialogResult = DialogResult.Cancel;
} }
private void chkenableRoutingAdvanced_CheckedChanged_1(object sender, EventArgs e) private void chkenableRoutingAdvanced_CheckedChanged_1(object sender, EventArgs e)
{ {
@@ -78,20 +79,20 @@ namespace v2rayN.Forms
{ {
if (chkenableRoutingAdvanced.Checked) if (chkenableRoutingAdvanced.Checked)
{ {
this.tabPageProxy.Parent = null; tabPageProxy.Parent = null;
this.tabPageDirect.Parent = null; tabPageDirect.Parent = null;
this.tabPageBlock.Parent = null; tabPageBlock.Parent = null;
this.tabPageRuleList.Parent = tabNormal; tabPageRuleList.Parent = tabNormal;
MenuItemBasic.Enabled = false; MenuItemBasic.Enabled = false;
MenuItemAdvanced.Enabled = true; MenuItemAdvanced.Enabled = true;
} }
else else
{ {
this.tabPageProxy.Parent = tabNormal; tabPageProxy.Parent = tabNormal;
this.tabPageDirect.Parent = tabNormal; tabPageDirect.Parent = tabNormal;
this.tabPageBlock.Parent = tabNormal; tabPageBlock.Parent = tabNormal;
this.tabPageRuleList.Parent = null; tabPageRuleList.Parent = null;
MenuItemBasic.Enabled = true; MenuItemBasic.Enabled = true;
MenuItemAdvanced.Enabled = false; MenuItemAdvanced.Enabled = false;
} }
@@ -102,31 +103,31 @@ namespace v2rayN.Forms
#region locked #region locked
private void BindingLockedData() private void BindingLockedData()
{ {
lockedItem = ConfigHandler.GetLockedRoutingItem(ref config); _lockedItem = ConfigHandler.GetLockedRoutingItem(ref config);
if (lockedItem != null) if (_lockedItem != null)
{ {
txtProxyDomain.Text = Utils.List2String(lockedItem.rules[0].domain, true); txtProxyDomain.Text = Utils.List2String(_lockedItem.rules[0].domain, true);
txtProxyIp.Text = Utils.List2String(lockedItem.rules[0].ip, true); txtProxyIp.Text = Utils.List2String(_lockedItem.rules[0].ip, true);
txtDirectDomain.Text = Utils.List2String(lockedItem.rules[1].domain, true); txtDirectDomain.Text = Utils.List2String(_lockedItem.rules[1].domain, true);
txtDirectIp.Text = Utils.List2String(lockedItem.rules[1].ip, true); txtDirectIp.Text = Utils.List2String(_lockedItem.rules[1].ip, true);
txtBlockDomain.Text = Utils.List2String(lockedItem.rules[2].domain, true); txtBlockDomain.Text = Utils.List2String(_lockedItem.rules[2].domain, true);
txtBlockIp.Text = Utils.List2String(lockedItem.rules[2].ip, true); txtBlockIp.Text = Utils.List2String(_lockedItem.rules[2].ip, true);
} }
} }
private void EndBindingLockedData() private void EndBindingLockedData()
{ {
if (lockedItem != null) if (_lockedItem != null)
{ {
lockedItem.rules[0].domain = Utils.String2List(txtProxyDomain.Text.TrimEx()); _lockedItem.rules[0].domain = Utils.String2List(txtProxyDomain.Text.TrimEx());
lockedItem.rules[0].ip = Utils.String2List(txtProxyIp.Text.TrimEx()); _lockedItem.rules[0].ip = Utils.String2List(txtProxyIp.Text.TrimEx());
lockedItem.rules[1].domain = Utils.String2List(txtDirectDomain.Text.TrimEx()); _lockedItem.rules[1].domain = Utils.String2List(txtDirectDomain.Text.TrimEx());
lockedItem.rules[1].ip = Utils.String2List(txtDirectIp.Text.TrimEx()); _lockedItem.rules[1].ip = Utils.String2List(txtDirectIp.Text.TrimEx());
lockedItem.rules[2].domain = Utils.String2List(txtBlockDomain.Text.TrimEx()); _lockedItem.rules[2].domain = Utils.String2List(txtBlockDomain.Text.TrimEx());
lockedItem.rules[2].ip = Utils.String2List(txtBlockIp.Text.TrimEx()); _lockedItem.rules[2].ip = Utils.String2List(txtBlockIp.Text.TrimEx());
} }
} }
@@ -169,7 +170,7 @@ namespace v2rayN.Forms
string def = string.Empty; string def = string.Empty;
if (config.routingIndex.Equals(k)) if (config.routingIndex.Equals(k))
{ {
def = "√"; def = Global.CheckMark;
} }
ListViewItem lvItem = new ListViewItem(def); ListViewItem lvItem = new ListViewItem(def);
@@ -207,7 +208,7 @@ namespace v2rayN.Forms
private int GetLvSelectedIndex() private int GetLvSelectedIndex()
{ {
int index = -1; int index = -1;
lvSelecteds.Clear(); _lvSelecteds.Clear();
try try
{ {
if (lvRoutings.SelectedIndices.Count <= 0) if (lvRoutings.SelectedIndices.Count <= 0)
@@ -219,7 +220,7 @@ namespace v2rayN.Forms
index = lvRoutings.SelectedIndices[0]; index = lvRoutings.SelectedIndices[0];
foreach (int i in lvRoutings.SelectedIndices) foreach (int i in lvRoutings.SelectedIndices)
{ {
lvSelecteds.Add(i); _lvSelecteds.Add(i);
} }
return index; return index;
} }
@@ -264,7 +265,7 @@ namespace v2rayN.Forms
{ {
return; return;
} }
for (int k = lvSelecteds.Count - 1; k >= 0; k--) for (int k = _lvSelecteds.Count - 1; k >= 0; k--)
{ {
config.routings.RemoveAt(index); config.routings.RemoveAt(index);
} }

File diff suppressed because it is too large Load Diff

View File

@@ -31,6 +31,8 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ServerTransportControl)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ServerTransportControl));
this.gbTransport = new System.Windows.Forms.GroupBox(); this.gbTransport = new System.Windows.Forms.GroupBox();
this.panTlsMore = new System.Windows.Forms.Panel(); this.panTlsMore = new System.Windows.Forms.Panel();
this.labfingerprint = new System.Windows.Forms.Label();
this.cmbFingerprint = new System.Windows.Forms.ComboBox();
this.clbAlpn = new System.Windows.Forms.CheckedListBox(); this.clbAlpn = new System.Windows.Forms.CheckedListBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.txtSNI = new System.Windows.Forms.TextBox(); this.txtSNI = new System.Windows.Forms.TextBox();
@@ -57,6 +59,7 @@
// //
// gbTransport // gbTransport
// //
resources.ApplyResources(this.gbTransport, "gbTransport");
this.gbTransport.Controls.Add(this.panTlsMore); this.gbTransport.Controls.Add(this.panTlsMore);
this.gbTransport.Controls.Add(this.tipNetwork); this.gbTransport.Controls.Add(this.tipNetwork);
this.gbTransport.Controls.Add(this.txtPath); this.gbTransport.Controls.Add(this.txtPath);
@@ -72,25 +75,38 @@
this.gbTransport.Controls.Add(this.labHeaderType); this.gbTransport.Controls.Add(this.labHeaderType);
this.gbTransport.Controls.Add(this.labRequestHost); this.gbTransport.Controls.Add(this.labRequestHost);
this.gbTransport.Controls.Add(this.cmbHeaderType); this.gbTransport.Controls.Add(this.cmbHeaderType);
resources.ApplyResources(this.gbTransport, "gbTransport");
this.gbTransport.Name = "gbTransport"; this.gbTransport.Name = "gbTransport";
this.gbTransport.TabStop = false; this.gbTransport.TabStop = false;
// //
// panTlsMore // panTlsMore
// //
resources.ApplyResources(this.panTlsMore, "panTlsMore");
this.panTlsMore.Controls.Add(this.labfingerprint);
this.panTlsMore.Controls.Add(this.cmbFingerprint);
this.panTlsMore.Controls.Add(this.clbAlpn); this.panTlsMore.Controls.Add(this.clbAlpn);
this.panTlsMore.Controls.Add(this.label1); this.panTlsMore.Controls.Add(this.label1);
this.panTlsMore.Controls.Add(this.txtSNI); this.panTlsMore.Controls.Add(this.txtSNI);
this.panTlsMore.Controls.Add(this.labSNI); this.panTlsMore.Controls.Add(this.labSNI);
this.panTlsMore.Controls.Add(this.labAllowInsecure); this.panTlsMore.Controls.Add(this.labAllowInsecure);
this.panTlsMore.Controls.Add(this.cmbAllowInsecure); this.panTlsMore.Controls.Add(this.cmbAllowInsecure);
resources.ApplyResources(this.panTlsMore, "panTlsMore");
this.panTlsMore.Name = "panTlsMore"; this.panTlsMore.Name = "panTlsMore";
// //
// labfingerprint
//
resources.ApplyResources(this.labfingerprint, "labfingerprint");
this.labfingerprint.Name = "labfingerprint";
//
// cmbFingerprint
//
resources.ApplyResources(this.cmbFingerprint, "cmbFingerprint");
this.cmbFingerprint.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbFingerprint.FormattingEnabled = true;
this.cmbFingerprint.Name = "cmbFingerprint";
//
// clbAlpn // clbAlpn
// //
this.clbAlpn.CheckOnClick = true;
resources.ApplyResources(this.clbAlpn, "clbAlpn"); resources.ApplyResources(this.clbAlpn, "clbAlpn");
this.clbAlpn.CheckOnClick = true;
this.clbAlpn.FormattingEnabled = true; this.clbAlpn.FormattingEnabled = true;
this.clbAlpn.Items.AddRange(new object[] { this.clbAlpn.Items.AddRange(new object[] {
resources.GetString("clbAlpn.Items"), resources.GetString("clbAlpn.Items"),
@@ -120,13 +136,13 @@
// //
// cmbAllowInsecure // cmbAllowInsecure
// //
resources.ApplyResources(this.cmbAllowInsecure, "cmbAllowInsecure");
this.cmbAllowInsecure.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbAllowInsecure.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbAllowInsecure.FormattingEnabled = true; this.cmbAllowInsecure.FormattingEnabled = true;
this.cmbAllowInsecure.Items.AddRange(new object[] { this.cmbAllowInsecure.Items.AddRange(new object[] {
resources.GetString("cmbAllowInsecure.Items"), resources.GetString("cmbAllowInsecure.Items"),
resources.GetString("cmbAllowInsecure.Items1"), resources.GetString("cmbAllowInsecure.Items1"),
resources.GetString("cmbAllowInsecure.Items2")}); resources.GetString("cmbAllowInsecure.Items2")});
resources.ApplyResources(this.cmbAllowInsecure, "cmbAllowInsecure");
this.cmbAllowInsecure.Name = "cmbAllowInsecure"; this.cmbAllowInsecure.Name = "cmbAllowInsecure";
// //
// tipNetwork // tipNetwork
@@ -141,9 +157,9 @@
// //
// cmbNetwork // cmbNetwork
// //
resources.ApplyResources(this.cmbNetwork, "cmbNetwork");
this.cmbNetwork.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbNetwork.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbNetwork.FormattingEnabled = true; this.cmbNetwork.FormattingEnabled = true;
resources.ApplyResources(this.cmbNetwork, "cmbNetwork");
this.cmbNetwork.Name = "cmbNetwork"; this.cmbNetwork.Name = "cmbNetwork";
this.cmbNetwork.SelectedIndexChanged += new System.EventHandler(this.cmbNetwork_SelectedIndexChanged); this.cmbNetwork.SelectedIndexChanged += new System.EventHandler(this.cmbNetwork_SelectedIndexChanged);
// //
@@ -174,9 +190,9 @@
// //
// cmbStreamSecurity // cmbStreamSecurity
// //
resources.ApplyResources(this.cmbStreamSecurity, "cmbStreamSecurity");
this.cmbStreamSecurity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbStreamSecurity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbStreamSecurity.FormattingEnabled = true; this.cmbStreamSecurity.FormattingEnabled = true;
resources.ApplyResources(this.cmbStreamSecurity, "cmbStreamSecurity");
this.cmbStreamSecurity.Name = "cmbStreamSecurity"; this.cmbStreamSecurity.Name = "cmbStreamSecurity";
this.cmbStreamSecurity.SelectedIndexChanged += new System.EventHandler(this.cmbStreamSecurity_SelectedIndexChanged); this.cmbStreamSecurity.SelectedIndexChanged += new System.EventHandler(this.cmbStreamSecurity_SelectedIndexChanged);
// //
@@ -202,9 +218,9 @@
// //
// cmbHeaderType // cmbHeaderType
// //
resources.ApplyResources(this.cmbHeaderType, "cmbHeaderType");
this.cmbHeaderType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbHeaderType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbHeaderType.FormattingEnabled = true; this.cmbHeaderType.FormattingEnabled = true;
resources.ApplyResources(this.cmbHeaderType, "cmbHeaderType");
this.cmbHeaderType.Name = "cmbHeaderType"; this.cmbHeaderType.Name = "cmbHeaderType";
// //
// ServerTransportControl // ServerTransportControl
@@ -246,5 +262,7 @@
private System.Windows.Forms.ComboBox cmbHeaderType; private System.Windows.Forms.ComboBox cmbHeaderType;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckedListBox clbAlpn; private System.Windows.Forms.CheckedListBox clbAlpn;
private System.Windows.Forms.Label labfingerprint;
private System.Windows.Forms.ComboBox cmbFingerprint;
} }
} }

View File

@@ -9,7 +9,7 @@ namespace v2rayN.Forms
public partial class ServerTransportControl : UserControl public partial class ServerTransportControl : UserControl
{ {
public bool AllowXtls { get; set; } public bool AllowXtls { get; set; }
private VmessItem vmessItem = null; private VmessItem vmessItem;
public ServerTransportControl() public ServerTransportControl()
{ {
@@ -32,6 +32,7 @@ namespace v2rayN.Forms
{ {
cmbStreamSecurity.Items.Add(Global.StreamSecurityX); cmbStreamSecurity.Items.Add(Global.StreamSecurityX);
} }
cmbFingerprint.Items.AddRange(Global.fingerprints.ToArray());
} }
public void BindingServer(VmessItem item) public void BindingServer(VmessItem item)
@@ -45,6 +46,7 @@ namespace v2rayN.Forms
cmbStreamSecurity.Text = vmessItem.streamSecurity; cmbStreamSecurity.Text = vmessItem.streamSecurity;
cmbAllowInsecure.Text = vmessItem.allowInsecure; cmbAllowInsecure.Text = vmessItem.allowInsecure;
txtSNI.Text = vmessItem.sni; txtSNI.Text = vmessItem.sni;
cmbFingerprint.Text = vmessItem.fingerprint;
if (vmessItem.alpn != null) if (vmessItem.alpn != null)
{ {
@@ -68,7 +70,8 @@ namespace v2rayN.Forms
cmbStreamSecurity.Text = ""; cmbStreamSecurity.Text = "";
cmbAllowInsecure.Text = ""; cmbAllowInsecure.Text = "";
txtPath.Text = ""; txtPath.Text = "";
txtSNI.Text = ""; txtSNI.Text = "";
cmbFingerprint.Text = "";
for (int i = 0; i < clbAlpn.Items.Count; i++) for (int i = 0; i < clbAlpn.Items.Count; i++)
{ {
clbAlpn.SetItemChecked(i, false); clbAlpn.SetItemChecked(i, false);
@@ -84,6 +87,7 @@ namespace v2rayN.Forms
string streamSecurity = cmbStreamSecurity.Text; string streamSecurity = cmbStreamSecurity.Text;
string allowInsecure = cmbAllowInsecure.Text; string allowInsecure = cmbAllowInsecure.Text;
string sni = txtSNI.Text; string sni = txtSNI.Text;
string fingerprint = cmbFingerprint.Text;
vmessItem.network = network; vmessItem.network = network;
vmessItem.headerType = headerType; vmessItem.headerType = headerType;
@@ -92,6 +96,7 @@ namespace v2rayN.Forms
vmessItem.streamSecurity = streamSecurity; vmessItem.streamSecurity = streamSecurity;
vmessItem.allowInsecure = allowInsecure; vmessItem.allowInsecure = allowInsecure;
vmessItem.sni = sni; vmessItem.sni = sni;
vmessItem.fingerprint = fingerprint;
var alpn = new List<string>(); var alpn = new List<string>();
for (int i = 0; i < clbAlpn.Items.Count; i++) for (int i = 0; i < clbAlpn.Items.Count; i++)

File diff suppressed because it is too large Load Diff

View File

@@ -119,49 +119,49 @@
</resheader> </resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="tipNetwork.Size" type="System.Drawing.Size, System.Drawing"> <data name="tipNetwork.Size" type="System.Drawing.Size, System.Drawing">
<value>143, 12</value> <value>182, 15</value>
</data> </data>
<data name="tipNetwork.Text" xml:space="preserve"> <data name="tipNetwork.Text" xml:space="preserve">
<value>*默认tcp,选错会无法连接</value> <value>*默认tcp,选错会无法连接</value>
</data> </data>
<data name="cmbNetwork.Location" type="System.Drawing.Point, System.Drawing"> <data name="cmbNetwork.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 28</value> <value>169, 36</value>
</data> </data>
<data name="cmbNetwork.Size" type="System.Drawing.Size, System.Drawing"> <data name="cmbNetwork.Size" type="System.Drawing.Size, System.Drawing">
<value>208, 20</value> <value>290, 23</value>
</data> </data>
<data name="labNetwork.Size" type="System.Drawing.Size, System.Drawing"> <data name="labNetwork.Size" type="System.Drawing.Size, System.Drawing">
<value>107, 12</value> <value>139, 15</value>
</data> </data>
<data name="labNetwork.Text" xml:space="preserve"> <data name="labNetwork.Text" xml:space="preserve">
<value>传输协议(network)</value> <value>传输协议(network)</value>
</data> </data>
<data name="labPath.Size" type="System.Drawing.Size, System.Drawing"> <data name="labPath.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value> <value>85, 15</value>
</data> </data>
<data name="labPath.Text" xml:space="preserve"> <data name="labPath.Text" xml:space="preserve">
<value>路径(path)</value> <value>路径(path)</value>
</data> </data>
<data name="labStreamSecurity.Size" type="System.Drawing.Size, System.Drawing"> <data name="labStreamSecurity.Size" type="System.Drawing.Size, System.Drawing">
<value>107, 12</value> <value>122, 15</value>
</data> </data>
<data name="labStreamSecurity.Text" xml:space="preserve"> <data name="labStreamSecurity.Text" xml:space="preserve">
<value>传输层安全(tls)</value> <value>传输层安全(tls)</value>
</data> </data>
<data name="txtRequestHost.Location" type="System.Drawing.Point, System.Drawing"> <data name="txtRequestHost.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 92</value> <value>169, 117</value>
</data> </data>
<data name="txtRequestHost.Size" type="System.Drawing.Size, System.Drawing"> <data name="txtRequestHost.Size" type="System.Drawing.Size, System.Drawing">
<value>331, 20</value> <value>442, 20</value>
</data> </data>
<data name="labHeaderType.Size" type="System.Drawing.Size, System.Drawing"> <data name="labHeaderType.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value> <value>115, 15</value>
</data> </data>
<data name="labHeaderType.Text" xml:space="preserve"> <data name="labHeaderType.Text" xml:space="preserve">
<value>伪装类型(type)</value> <value>伪装类型(type)</value>
</data> </data>
<data name="labRequestHost.Size" type="System.Drawing.Size, System.Drawing"> <data name="labRequestHost.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value> <value>115, 15</value>
</data> </data>
<data name="labRequestHost.Text" xml:space="preserve"> <data name="labRequestHost.Text" xml:space="preserve">
<value>伪装域名(host)</value> <value>伪装域名(host)</value>
@@ -169,25 +169,25 @@
<data name="gbTransport.Text" xml:space="preserve"> <data name="gbTransport.Text" xml:space="preserve">
<value>底层传输方式(transport)</value> <value>底层传输方式(transport)</value>
</data> </data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>282, 11</value>
</data>
<data name="clbAlpn.Location" type="System.Drawing.Point, System.Drawing"> <data name="clbAlpn.Location" type="System.Drawing.Point, System.Drawing">
<value>331, 7</value> <value>427, 9</value>
</data> </data>
<data name="clbAlpn.Size" type="System.Drawing.Size, System.Drawing"> <data name="clbAlpn.Size" type="System.Drawing.Size, System.Drawing">
<value>160, 20</value> <value>208, 24</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>378, 14</value>
</data> </data>
<data name="txtSNI.Size" type="System.Drawing.Size, System.Drawing"> <data name="txtSNI.Size" type="System.Drawing.Size, System.Drawing">
<value>391, 21</value> <value>391, 25</value>
</data> </data>
<data name="labAllowInsecure.Size" type="System.Drawing.Size, System.Drawing"> <data name="labAllowInsecure.Size" type="System.Drawing.Size, System.Drawing">
<value>167, 12</value> <value>217, 15</value>
</data> </data>
<data name="labAllowInsecure.Text" xml:space="preserve"> <data name="labAllowInsecure.Text" xml:space="preserve">
<value>跳过证书验证(allowInsecure)</value> <value>跳过证书验证(allowInsecure)</value>
</data> </data>
<data name="cmbAllowInsecure.Location" type="System.Drawing.Point, System.Drawing"> <data name="cmbAllowInsecure.Location" type="System.Drawing.Point, System.Drawing">
<value>183, 7</value> <value>247, 10</value>
</data> </data>
</root> </root>

View File

@@ -26,7 +26,7 @@ namespace v2rayN.Forms
private void SubSettingControl_Load(object sender, EventArgs e) private void SubSettingControl_Load(object sender, EventArgs e)
{ {
this.Height = grbMain.Height; Height = grbMain.Height;
groupItem = LazyConfig.Instance.GetConfig().groupItem; groupItem = LazyConfig.Instance.GetConfig().groupItem;
@@ -90,7 +90,7 @@ namespace v2rayN.Forms
private void btnShare_Click(object sender, EventArgs e) private void btnShare_Click(object sender, EventArgs e)
{ {
if (this.Height <= grbMain.Height) if (Height <= grbMain.Height)
{ {
if (Utils.IsNullOrEmpty(subItem.url)) if (Utils.IsNullOrEmpty(subItem.url))
{ {
@@ -98,11 +98,11 @@ namespace v2rayN.Forms
return; return;
} }
picQRCode.Image = QRCodeHelper.GetQRCode(subItem.url); picQRCode.Image = QRCodeHelper.GetQRCode(subItem.url);
this.Height = grbMain.Height + 200; Height = grbMain.Height + 200;
} }
else else
{ {
this.Height = grbMain.Height; Height = grbMain.Height;
} }
} }
} }

View File

@@ -71,7 +71,7 @@ namespace v2rayN.Forms
{ {
if (ConfigHandler.SaveSubItem(ref config) == 0) if (ConfigHandler.SaveSubItem(ref config) == 0)
{ {
this.DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }
else else
{ {
@@ -81,7 +81,7 @@ namespace v2rayN.Forms
private void btnClose_Click(object sender, EventArgs e) private void btnClose_Click(object sender, EventArgs e)
{ {
this.DialogResult = DialogResult.Cancel; DialogResult = DialogResult.Cancel;
} }
private void btnAdd_Click(object sender, EventArgs e) private void btnAdd_Click(object sender, EventArgs e)

View File

@@ -13,9 +13,15 @@ namespace v2rayN
public const string UpdateUrl = AboutUrl + @"/releases"; public const string UpdateUrl = AboutUrl + @"/releases";
public const string v2flyCoreUrl = "https://github.com/v2fly/v2ray-core/releases"; public const string v2flyCoreUrl = "https://github.com/v2fly/v2ray-core/releases";
public const string xrayCoreUrl = "https://github.com/XTLS/Xray-core/releases"; public const string xrayCoreUrl = "https://github.com/XTLS/Xray-core/releases";
public const string SagerNetCoreUrl = "https://github.com/SagerNet/v2ray-core/releases";
public const string NUrl = @"https://github.com/2dust/v2rayN/releases"; public const string NUrl = @"https://github.com/2dust/v2rayN/releases";
public const string clashCoreUrl = "https://github.com/Dreamacro/clash/releases"; public const string clashCoreUrl = "https://github.com/Dreamacro/clash/releases";
public const string clashMetaCoreUrl = "https://github.com/MetaCubeX/Clash.Meta/releases";
public const string hysteriaCoreUrl = "https://github.com/HyNetwork/hysteria/releases"; public const string hysteriaCoreUrl = "https://github.com/HyNetwork/hysteria/releases";
public const string naiveproxyCoreUrl = "https://github.com/klzgrad/naiveproxy/releases";
public const string tuicCoreUrl = "https://github.com/EAimTY/tuic/releases";
public const string singboxCoreUrl = "https://github.com/SagerNet/sing-box/releases";
public const string geoUrl = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/{0}.dat";
@@ -64,9 +70,10 @@ namespace v2rayN
/// </summary> /// </summary>
public const string v2raySampleHttpresponseFileName = "v2rayN.Sample.SampleHttpresponse.txt"; public const string v2raySampleHttpresponseFileName = "v2rayN.Sample.SampleHttpresponse.txt";
public const string CustomRoutingFileName = "v2rayN.Sample.custom_routing_"; public const string CustomRoutingFileName = "v2rayN.Sample.custom_routing_";
public const string v2raySampleInbound = "v2rayN.Sample.SampleInbound.txt";
/// <summary> /// <summary>
/// 默认加密方式 /// 默认加密方式
@@ -111,6 +118,7 @@ namespace v2rayN
public const string InboundSocks = "socks"; public const string InboundSocks = "socks";
public const string InboundHttp = "http"; public const string InboundHttp = "http";
public const string InboundSocks2 = "socks2";
public const string InboundHttp2 = "http2"; public const string InboundHttp2 = "http2";
public const string Loopback = "127.0.0.1"; public const string Loopback = "127.0.0.1";
public const string InboundAPITagName = "api"; public const string InboundAPITagName = "api";
@@ -186,27 +194,33 @@ namespace v2rayN
/// </summary> /// </summary>
public const string CustomIconName = "v2rayN.ico"; public const string CustomIconName = "v2rayN.ico";
public enum StatisticsFreshRate
{
quick = 1000,
medium = 2000,
slow = 3000
}
public const string StatisticLogOverall = "StatisticLogOverall.json"; public const string StatisticLogOverall = "StatisticLogOverall.json";
public const string IEProxyExceptions = "localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*"; public const string IEProxyExceptions = "localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*";
public static readonly List<string> IEProxyProtocols = new List<string> {
"{ip}:{http_port}",
"socks={ip}:{socks_port}",
"http={ip}:{http_port};https={ip}:{http_port};ftp={ip}:{http_port};socks={ip}:{socks_port}",
"http=http://{ip}:{http_port};https=http://{ip}:{http_port}",
""
};
public const string RoutingRuleComma = "<COMMA>"; public const string RoutingRuleComma = "<COMMA>";
public static readonly List<string> vmessSecuritys = new List<string> { "aes-128-gcm", "chacha20-poly1305", "auto", "none", "zero" }; public static readonly List<string> vmessSecuritys = new List<string> { "aes-128-gcm", "chacha20-poly1305", "auto", "none", "zero" };
public static readonly List<string> ssSecuritys = new List<string> { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "none", "plain" }; public static readonly List<string> ssSecuritys = new List<string> { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "none", "plain" };
public static readonly List<string> ssSecuritysInXray = new List<string> { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "xchacha20-poly1305", "xchacha20-ietf-poly1305", "none", "plain" }; public static readonly List<string> ssSecuritysInSagerNet = new List<string> { "none", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305", "aes-128-gcm", "aes-192-gcm", "aes-256-gcm", "chacha20-ietf-poly1305", "xchacha20-ietf-poly1305", "rc4", "rc4-md5", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-cfb8", "aes-192-cfb8", "aes-256-cfb8", "aes-128-ofb", "aes-192-ofb", "aes-256-ofb", "bf-cfb", "cast5-cfb", "des-cfb", "idea-cfb", "rc2-cfb", "seed-cfb", "camellia-128-cfb", "camellia-192-cfb", "camellia-256-cfb", "camellia-128-cfb8", "camellia-192-cfb8", "camellia-256-cfb8", "salsa20", "chacha20", "chacha20-ietf", "xchacha20" };
public static readonly List<string> xtlsFlows = new List<string> { "", "xtls-rprx-origin", "xtls-rprx-origin-udp443", "xtls-rprx-direct", "xtls-rprx-direct-udp443" }; public static readonly List<string> ssSecuritysInXray = new List<string> { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "xchacha20-poly1305", "xchacha20-ietf-poly1305", "none", "plain", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305" };
public static readonly List<string> xtlsFlows = new List<string> { "", "xtls-rprx-origin", "xtls-rprx-origin-udp443", "xtls-rprx-direct", "xtls-rprx-direct-udp443", "xtls-rprx-vision", "xtls-rprx-vision-udp443" };
public static readonly List<string> networks = new List<string> { "tcp", "kcp", "ws", "h2", "quic", "grpc" }; public static readonly List<string> networks = new List<string> { "tcp", "kcp", "ws", "h2", "quic", "grpc" };
public static readonly List<string> kcpHeaderTypes = new List<string> { "srtp", "utp", "wechat-video", "dtls", "wireguard" }; public static readonly List<string> kcpHeaderTypes = new List<string> { "srtp", "utp", "wechat-video", "dtls", "wireguard" };
public static readonly List<string> coreTypes = new List<string> { "v2fly", "Xray" }; public static readonly List<string> coreTypes = new List<string> { "v2fly", "SagerNet", "Xray", "v2fly_v5" };
public static readonly List<string> domainMatchers = new List<string> { "linear", "mph", "" };
public static readonly List<string> fingerprints = new List<string> { "chrome", "firefox", "safari", "randomized", "" };
public static readonly List<string> domainStrategy4Freedoms = new List<string> { "AsIs", "UseIP", "UseIPv4", "UseIPv6", "" };
public const string GrpcgunMode = "gun"; public const string GrpcgunMode = "gun";
public const string GrpcmultiMode = "multi"; public const string GrpcmultiMode = "multi";
public const string CheckMark = "√";
#endregion #endregion

View File

@@ -6,6 +6,7 @@ using v2rayN.Mode;
using v2rayN.Base; using v2rayN.Base;
using System.Linq; using System.Linq;
using v2rayN.Tool; using v2rayN.Tool;
using System.Threading.Tasks;
namespace v2rayN.Handler namespace v2rayN.Handler
{ {
@@ -53,11 +54,9 @@ namespace v2rayN.Handler
//Mux //Mux
muxEnabled = false, muxEnabled = false,
// 默认不开启统计
enableStatistics = false, enableStatistics = false,
// 默认中等刷新率 statisticsFreshRate = 1,
statisticsFreshRate = (int)Global.StatisticsFreshRate.medium,
enableRoutingAdvanced = true enableRoutingAdvanced = true
}; };
@@ -96,10 +95,10 @@ namespace v2rayN.Handler
{ {
config.domainStrategy = "IPIfNonMatch"; config.domainStrategy = "IPIfNonMatch";
} }
if (Utils.IsNullOrEmpty(config.domainMatcher)) //if (Utils.IsNullOrEmpty(config.domainMatcher))
{ //{
config.domainMatcher = "linear"; // config.domainMatcher = "linear";
} //}
//kcp //kcp
if (config.kcpItem == null) if (config.kcpItem == null)
@@ -157,7 +156,10 @@ namespace v2rayN.Handler
{ {
config.groupItem = new List<GroupItem>(); config.groupItem = new List<GroupItem>();
} }
if (config.statisticsFreshRate > 100 || config.statisticsFreshRate < 1)
{
config.statisticsFreshRate = 1;
}
if (config == null if (config == null
|| config.vmess.Count <= 0 || config.vmess.Count <= 0
@@ -207,7 +209,28 @@ namespace v2rayN.Handler
{ {
lock (objLock) lock (objLock)
{ {
Utils.ToJsonFile(config, Utils.GetPath(configRes)); try
{
//save temp file
var resPath = Utils.GetPath(configRes);
var tempPath = $"{resPath}_temp";
if (Utils.ToJsonFile(config, tempPath) != 0)
{
return;
}
if (File.Exists(resPath))
{
File.Delete(resPath);
}
//rename
File.Move(tempPath, resPath);
}
catch (Exception ex)
{
Utils.SaveLog("ToJsonFile", ex);
}
} }
} }
@@ -223,7 +246,7 @@ namespace v2rayN.Handler
/// <returns></returns> /// <returns></returns>
public static int AddServer(ref Config config, VmessItem vmessItem, bool toFile = true) public static int AddServer(ref Config config, VmessItem vmessItem, bool toFile = true)
{ {
vmessItem.configType = EConfigType.Vmess; vmessItem.configType = EConfigType.VMess;
vmessItem.address = vmessItem.address.TrimEx(); vmessItem.address = vmessItem.address.TrimEx();
vmessItem.id = vmessItem.id.TrimEx(); vmessItem.id = vmessItem.id.TrimEx();
@@ -282,9 +305,19 @@ namespace v2rayN.Handler
{ {
VmessItem vmessItem = Utils.DeepCopy(item); VmessItem vmessItem = Utils.DeepCopy(item);
vmessItem.indexId = string.Empty; vmessItem.indexId = string.Empty;
vmessItem.remarks = string.Format("{0}-clone", item.remarks); vmessItem.remarks = $"{item.remarks}-clone";
AddServerCommon(ref config, vmessItem); if (vmessItem.configType == EConfigType.Custom)
{
vmessItem.address = Utils.GetConfigPath(vmessItem.address);
if (AddCustomServer(ref config, vmessItem, false) == 0)
{
}
}
else
{
AddServerCommon(ref config, vmessItem);
}
} }
ToJsonFile(config); ToJsonFile(config);
@@ -437,19 +470,20 @@ namespace v2rayN.Handler
return -1; return -1;
} }
var ext = Path.GetExtension(fileName); var ext = Path.GetExtension(fileName);
string newFileName = string.Format("{0}{1}", Utils.GetGUID(), ext); string newFileName = $"{Utils.GetGUID()}{ext}";
//newFileName = Path.Combine(Utils.GetTempPath(), newFileName); //newFileName = Path.Combine(Utils.GetTempPath(), newFileName);
try try
{ {
File.Copy(fileName, Path.Combine(Utils.GetConfigPath(), newFileName)); File.Copy(fileName, Utils.GetConfigPath(newFileName));
if (blDelete) if (blDelete)
{ {
File.Delete(fileName); File.Delete(fileName);
} }
} }
catch catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex);
return -1; return -1;
} }
@@ -457,7 +491,7 @@ namespace v2rayN.Handler
vmessItem.configType = EConfigType.Custom; vmessItem.configType = EConfigType.Custom;
if (Utils.IsNullOrEmpty(vmessItem.remarks)) if (Utils.IsNullOrEmpty(vmessItem.remarks))
{ {
vmessItem.remarks = string.Format("import custom@{0}", DateTime.Now.ToShortDateString()); vmessItem.remarks = $"import custom@{DateTime.Now.ToShortDateString()}";
} }
@@ -495,7 +529,7 @@ namespace v2rayN.Handler
vmessItem.id = vmessItem.id.TrimEx(); vmessItem.id = vmessItem.id.TrimEx();
vmessItem.security = vmessItem.security.TrimEx(); vmessItem.security = vmessItem.security.TrimEx();
if (!LazyConfig.Instance.GetShadowsocksSecuritys().Contains(vmessItem.security)) if (!LazyConfig.Instance.GetShadowsocksSecuritys(vmessItem).Contains(vmessItem.security))
{ {
return -1; return -1;
} }
@@ -577,7 +611,7 @@ namespace v2rayN.Handler
{ {
return 0; return 0;
} }
if (vmessItem.configType == EConfigType.Vmess) if (vmessItem.configType == EConfigType.VMess)
{ {
string path = ""; string path = "";
string host = ""; string host = "";
@@ -780,9 +814,10 @@ namespace v2rayN.Handler
&& o.headerType == n.headerType && o.headerType == n.headerType
&& o.requestHost == n.requestHost && o.requestHost == n.requestHost
&& o.path == n.path && o.path == n.path
&& o.streamSecurity == n.streamSecurity && (o.configType == EConfigType.Trojan || o.streamSecurity == n.streamSecurity)
&& o.flow == n.flow && o.flow == n.flow
&& (remarks ? o.remarks == n.remarks : true); && o.sni == n.sni
&& (!remarks || o.remarks == n.remarks);
} }
private static int RemoveVmessItem(Config config, int index) private static int RemoveVmessItem(Config config, int index)
@@ -864,7 +899,7 @@ namespace v2rayN.Handler
//groupId //groupId
vmessItem.groupId = groupId; vmessItem.groupId = groupId;
if (vmessItem.configType == EConfigType.Vmess) if (vmessItem.configType == EConfigType.VMess)
{ {
if (AddServer(ref config, vmessItem, false) == 0) if (AddServer(ref config, vmessItem, false) == 0)
{ {
@@ -940,14 +975,43 @@ namespace v2rayN.Handler
vmessItem.address = fileName; vmessItem.address = fileName;
vmessItem.remarks = "clash_custom"; vmessItem.remarks = "clash_custom";
} }
//Is hysteria configuration
else if (clipboardData.IndexOf("server") >= 0
&& clipboardData.IndexOf("up") >= 0
&& clipboardData.IndexOf("down") >= 0
&& clipboardData.IndexOf("listen") >= 0
&& clipboardData.IndexOf("<html>") < 0
&& clipboardData.IndexOf("<body>") < 0)
{
var fileName = Utils.GetTempPath($"{Utils.GetGUID(false)}.json");
File.WriteAllText(fileName, clipboardData);
vmessItem.coreType = ECoreType.hysteria;
vmessItem.address = fileName;
vmessItem.remarks = "hysteria_custom";
}
//Is naiveproxy configuration
else if (clipboardData.IndexOf("listen") >= 0
&& clipboardData.IndexOf("proxy") >= 0
&& clipboardData.IndexOf("<html>") < 0
&& clipboardData.IndexOf("<body>") < 0)
{
var fileName = Utils.GetTempPath($"{Utils.GetGUID(false)}.json");
File.WriteAllText(fileName, clipboardData);
vmessItem.coreType = ECoreType.naiveproxy;
vmessItem.address = fileName;
vmessItem.remarks = "naiveproxy_custom";
}
//Is Other configuration //Is Other configuration
else else
{ {
var fileName = Utils.GetTempPath($"{Utils.GetGUID(false)}.txt"); return -1;
File.WriteAllText(fileName, clipboardData); //var fileName = Utils.GetTempPath($"{Utils.GetGUID(false)}.txt");
//File.WriteAllText(fileName, clipboardData);
vmessItem.address = fileName; //vmessItem.address = fileName;
vmessItem.remarks = "other_custom"; //vmessItem.remarks = "other_custom";
} }
if (!Utils.IsNullOrEmpty(subid)) if (!Utils.IsNullOrEmpty(subid))
@@ -977,6 +1041,56 @@ namespace v2rayN.Handler
} }
} }
private static int AddBatchServers4SsSIP008(ref Config config, string clipboardData, string subid, List<VmessItem> lstOriSub, string groupId)
{
if (Utils.IsNullOrEmpty(clipboardData))
{
return -1;
}
if (!Utils.IsNullOrEmpty(subid))
{
RemoveServerViaSubid(ref config, subid);
}
//SsSIP008
var lstSsServer = Utils.FromJson<List<SsServer>>(clipboardData);
if (lstSsServer == null || lstSsServer.Count <= 0)
{
var ssSIP008 = Utils.FromJson<SsSIP008>(clipboardData);
if (ssSIP008?.servers != null && ssSIP008.servers.Count > 0)
{
lstSsServer = ssSIP008.servers;
}
}
if (lstSsServer != null && lstSsServer.Count > 0)
{
int counter = 0;
foreach (var it in lstSsServer)
{
var ssItem = new VmessItem()
{
subid = subid,
groupId = groupId,
remarks = it.remarks,
security = it.method,
id = it.password,
address = it.server,
port = Utils.ToInt(it.server_port)
};
if (AddShadowsocksServer(ref config, ssItem, false) == 0)
{
counter++;
}
}
ToJsonFile(config);
return counter;
}
return -1;
}
public static int AddBatchServers(ref Config config, string clipboardData, string subid, string groupId) public static int AddBatchServers(ref Config config, string clipboardData, string subid, string groupId)
{ {
List<VmessItem> lstOriSub = null; List<VmessItem> lstOriSub = null;
@@ -991,6 +1105,11 @@ namespace v2rayN.Handler
counter = AddBatchServers(ref config, Utils.Base64Decode(clipboardData), subid, lstOriSub, groupId); counter = AddBatchServers(ref config, Utils.Base64Decode(clipboardData), subid, lstOriSub, groupId);
} }
if (counter < 1)
{
counter = AddBatchServers4SsSIP008(ref config, clipboardData, subid, lstOriSub, groupId);
}
//maybe other sub //maybe other sub
if (counter < 1) if (counter < 1)
{ {
@@ -1042,12 +1161,9 @@ namespace v2rayN.Handler
return -1; return -1;
} }
foreach (SubItem item in config.subItem) foreach (var item in config.subItem.Where(item => Utils.IsNullOrEmpty(item.id)))
{ {
if (Utils.IsNullOrEmpty(item.id)) item.id = Utils.GetGUID(false);
{
item.id = Utils.GetGUID(false);
}
} }
ToJsonFile(config); ToJsonFile(config);
@@ -1091,12 +1207,9 @@ namespace v2rayN.Handler
return -1; return -1;
} }
foreach (GroupItem item in config.groupItem) foreach (var item in config.groupItem.Where(item => Utils.IsNullOrEmpty(item.id)))
{ {
if (Utils.IsNullOrEmpty(item.id)) item.id = Utils.GetGUID(false);
{
item.id = Utils.GetGUID(false);
}
} }
ToJsonFile(config); ToJsonFile(config);
@@ -1206,6 +1319,10 @@ namespace v2rayN.Handler
{ {
config.routingIndex = 0; config.routingIndex = 0;
} }
if (config.trayMenuServersLimit <= 0)
{
config.trayMenuServersLimit = 30;
}
Global.reloadV2ray = true; Global.reloadV2ray = true;

View File

@@ -4,6 +4,7 @@ using System.IO;
using System.Net; using System.Net;
using System.Net.Http; using System.Net.Http;
using System.Net.Http.Headers; using System.Net.Http.Headers;
using System.Net.Sockets;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -29,8 +30,8 @@ namespace v2rayN.Handler
public ResultEventArgs(bool success, string msg) public ResultEventArgs(bool success, string msg)
{ {
this.Success = success; Success = success;
this.Msg = msg; Msg = msg;
} }
} }
@@ -39,19 +40,19 @@ namespace v2rayN.Handler
try try
{ {
Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().enableSecurityProtocolTls13); Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().enableSecurityProtocolTls13);
UpdateCompleted?.Invoke(this, new ResultEventArgs(false, ResUI.Downloading)); UpdateCompleted?.Invoke(this, new ResultEventArgs(false, ResUI.Speedtesting));
var client = new HttpClient(new WebRequestHandler() var client = new HttpClient(new WebRequestHandler()
{ {
Proxy = webProxy Proxy = webProxy
}); });
var progress = new Progress<double>(); var progress = new Progress<string>();
progress.ProgressChanged += (sender, value) => progress.ProgressChanged += (sender, value) =>
{ {
if (UpdateCompleted != null) if (UpdateCompleted != null)
{ {
string msg = string.Format("{0} M/s", value.ToString("#0.0")); string msg = $"{value} M/s".PadLeft(9, ' ');
UpdateCompleted(this, new ResultEventArgs(false, msg)); UpdateCompleted(this, new ResultEventArgs(false, msg));
} }
}; };
@@ -66,7 +67,11 @@ namespace v2rayN.Handler
catch (Exception ex) catch (Exception ex)
{ {
//Utils.SaveLog(ex.Message, ex); //Utils.SaveLog(ex.Message, ex);
Error?.Invoke(this, new ErrorEventArgs(ex)); Error?.Invoke(this, new ErrorEventArgs(ex));
if (ex.InnerException != null)
{
Error?.Invoke(this, new ErrorEventArgs(ex.InnerException));
}
} }
return 0; return 0;
} }
@@ -88,7 +93,7 @@ namespace v2rayN.Handler
{ {
if (UpdateCompleted != null) if (UpdateCompleted != null)
{ {
string msg = string.Format("...{0}%", value); string msg = $"...{value}%";
UpdateCompleted(this, new ResultEventArgs(value > 100 ? true : false, msg)); UpdateCompleted(this, new ResultEventArgs(value > 100 ? true : false, msg));
} }
}; };
@@ -104,7 +109,11 @@ namespace v2rayN.Handler
{ {
Utils.SaveLog(ex.Message, ex); Utils.SaveLog(ex.Message, ex);
Error?.Invoke(this, new ErrorEventArgs(ex)); Error?.Invoke(this, new ErrorEventArgs(ex));
if (ex.InnerException != null)
{
Error?.Invoke(this, new ErrorEventArgs(ex.InnerException));
}
} }
} }
@@ -156,12 +165,21 @@ namespace v2rayN.Handler
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Utils.Base64Encode(uri.UserInfo)); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Utils.Base64Encode(uri.UserInfo));
} }
var result = await HttpClientHelper.GetInstance().GetAsync(client, url);
var cts = new CancellationTokenSource();
cts.CancelAfter(1000 * 30);
var result = await HttpClientHelper.GetInstance().GetAsync(client, url, cts.Token);
return result; return result;
} }
catch (Exception ex) catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex); Utils.SaveLog(ex.Message, ex);
Error?.Invoke(this, new ErrorEventArgs(ex));
if (ex.InnerException != null)
{
Error?.Invoke(this, new ErrorEventArgs(ex.InnerException));
}
} }
return null; return null;
} }
@@ -172,25 +190,21 @@ namespace v2rayN.Handler
{ {
if (webProxy == null) if (webProxy == null)
{ {
var httpPort = LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundHttp2); var httpPort = LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundHttp);
webProxy = new WebProxy(Global.Loopback, httpPort); webProxy = new WebProxy(Global.Loopback, httpPort);
} }
Task<int> t = Task.Run(() => try
{ {
try string status = GetRealPingTime(Global.SpeedPingTestUrl, webProxy, out int responseTime);
{ bool noError = Utils.IsNullOrEmpty(status);
string status = GetRealPingTime(Global.SpeedPingTestUrl, webProxy, out int responseTime); return noError ? responseTime : -1;
bool noError = Utils.IsNullOrEmpty(status); }
return noError ? responseTime : -1; catch (Exception ex)
} {
catch (Exception ex) Utils.SaveLog(ex.Message, ex);
{ return -1;
Utils.SaveLog(ex.Message, ex); }
return -1;
}
});
return t.Result;
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -206,7 +220,7 @@ namespace v2rayN.Handler
try try
{ {
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url); HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
myHttpWebRequest.Timeout = 5000; myHttpWebRequest.Timeout = 30 * 1000;
myHttpWebRequest.Proxy = webProxy; myHttpWebRequest.Proxy = webProxy;
Stopwatch timer = new Stopwatch(); Stopwatch timer = new Stopwatch();
@@ -237,14 +251,36 @@ namespace v2rayN.Handler
{ {
return null; return null;
} }
var httpPort = LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundHttp2); var httpPort = LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundHttp);
var webProxy = new WebProxy(Global.Loopback, httpPort); if (!SocketCheck(Global.Loopback, httpPort))
if (RunAvailabilityCheck(webProxy) > 0)
{ {
return webProxy; return null;
} }
return null; return new WebProxy(Global.Loopback, httpPort);
}
private bool SocketCheck(string ip, int port)
{
Socket sock = null;
try
{
IPAddress ipa = IPAddress.Parse(ip);
IPEndPoint point = new IPEndPoint(ipa, port);
sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
sock.Connect(point);
return true;
}
catch { }
finally
{
if (sock != null)
{
sock.Close();
sock.Dispose();
}
}
return false;
} }
} }
} }

View File

@@ -11,10 +11,8 @@ namespace v2rayN.Handler
private Config _config; private Config _config;
private List<CoreInfo> coreInfos; private List<CoreInfo> coreInfos;
public static LazyConfig Instance public static LazyConfig Instance => _instance.Value;
{
get { return _instance.Value; }
}
public void SetConfig(ref Config config) public void SetConfig(ref Config config)
{ {
_config = config; _config = config;
@@ -24,14 +22,18 @@ namespace v2rayN.Handler
return _config; return _config;
} }
public List<string> GetShadowsocksSecuritys() public List<string> GetShadowsocksSecuritys(VmessItem vmessItem)
{ {
if (GetCoreType(null, EConfigType.Shadowsocks) == ECoreType.v2fly) if (GetCoreType(vmessItem, EConfigType.Shadowsocks) == ECoreType.v2fly)
{ {
return Global.ssSecuritys; return Global.ssSecuritys;
} }
if (GetCoreType(vmessItem, EConfigType.Shadowsocks) == ECoreType.Xray)
{
return Global.ssSecuritysInXray;
}
return Global.ssSecuritysInXray; return Global.ssSecuritysInSagerNet;
} }
public ECoreType GetCoreType(VmessItem vmessItem, EConfigType eConfigType) public ECoreType GetCoreType(VmessItem vmessItem, EConfigType eConfigType)
@@ -66,13 +68,55 @@ namespace v2rayN.Handler
{ {
coreInfos = new List<CoreInfo>(); coreInfos = new List<CoreInfo>();
coreInfos.Add(new CoreInfo
{
coreType = ECoreType.v2rayN,
coreUrl = Global.NUrl,
coreReleaseApiUrl = Global.NUrl.Replace(@"https://github.com", @"https://api.github.com/repos"),
coreDownloadUrl32 = Global.NUrl + "/download/{0}/v2rayN.zip",
coreDownloadUrl64 = Global.NUrl + "/download/{0}/v2rayN.zip",
});
coreInfos.Add(new CoreInfo coreInfos.Add(new CoreInfo
{ {
coreType = ECoreType.v2fly, coreType = ECoreType.v2fly,
coreExes = new List<string> { "wv2ray", "v2ray" }, coreExes = new List<string> { "wv2ray", "v2ray" },
arguments = "", arguments = "",
coreUrl = Global.v2flyCoreUrl, coreUrl = Global.v2flyCoreUrl,
match = "V2Ray" coreReleaseApiUrl = Global.v2flyCoreUrl.Replace(@"https://github.com", @"https://api.github.com/repos"),
coreDownloadUrl32 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
coreDownloadUrl64 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
match = "V2Ray",
versionArg = "-version",
redirectInfo = true,
});
coreInfos.Add(new CoreInfo
{
coreType = ECoreType.SagerNet,
coreExes = new List<string> { "SagerNet", "v2ray" },
arguments = "run",
coreUrl = Global.SagerNetCoreUrl,
coreReleaseApiUrl = Global.SagerNetCoreUrl.Replace(@"https://github.com", @"https://api.github.com/repos"),
coreDownloadUrl32 = Global.SagerNetCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
coreDownloadUrl64 = Global.SagerNetCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
match = "V2Ray",
versionArg = "version",
redirectInfo = true,
});
coreInfos.Add(new CoreInfo
{
coreType = ECoreType.v2fly_v5,
coreExes = new List<string> { "v2ray" },
arguments = "run",
coreUrl = Global.v2flyCoreUrl,
coreReleaseApiUrl = Global.v2flyCoreUrl.Replace(@"https://github.com", @"https://api.github.com/repos"),
coreDownloadUrl32 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
coreDownloadUrl64 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
match = "V2Ray",
versionArg = "version",
redirectInfo = true,
}); });
coreInfos.Add(new CoreInfo coreInfos.Add(new CoreInfo
@@ -81,23 +125,79 @@ namespace v2rayN.Handler
coreExes = new List<string> { "xray" }, coreExes = new List<string> { "xray" },
arguments = "", arguments = "",
coreUrl = Global.xrayCoreUrl, coreUrl = Global.xrayCoreUrl,
match = "Xray" coreReleaseApiUrl = Global.xrayCoreUrl.Replace(@"https://github.com", @"https://api.github.com/repos"),
coreDownloadUrl32 = Global.xrayCoreUrl + "/download/{0}/Xray-windows-{1}.zip",
coreDownloadUrl64 = Global.xrayCoreUrl + "/download/{0}/Xray-windows-{1}.zip",
match = "Xray",
versionArg = "-version",
redirectInfo = true,
}); });
coreInfos.Add(new CoreInfo coreInfos.Add(new CoreInfo
{ {
coreType = ECoreType.clash, coreType = ECoreType.clash,
coreExes = new List<string> { "clash-windows-amd64", "clash-windows-386", "clash" }, coreExes = new List<string> { "clash-windows-amd64-v3", "clash-windows-amd64", "clash-windows-386", "clash" },
arguments = "-f config.json", arguments = "-f config.json",
coreUrl = Global.clashCoreUrl coreUrl = Global.clashCoreUrl,
coreReleaseApiUrl = Global.clashCoreUrl.Replace(@"https://github.com", @"https://api.github.com/repos"),
coreDownloadUrl32 = Global.clashCoreUrl + "/download/{0}/clash-windows-386-{0}.zip",
coreDownloadUrl64 = Global.clashCoreUrl + "/download/{0}/clash-windows-amd64-{0}.zip",
match = "v",
versionArg = "-v",
redirectInfo = true,
});
coreInfos.Add(new CoreInfo
{
coreType = ECoreType.clash_meta,
coreExes = new List<string> { "Clash.Meta-windows-amd64-compatible", "Clash.Meta-windows-amd64", "Clash.Meta-windows-386", "Clash.Meta", "clash" },
arguments = "-f config.json",
coreUrl = Global.clashMetaCoreUrl,
coreReleaseApiUrl = Global.clashMetaCoreUrl.Replace(@"https://github.com", @"https://api.github.com/repos"),
coreDownloadUrl32 = Global.clashMetaCoreUrl + "/download/{0}/Clash.Meta-windows-386-{0}.zip",
coreDownloadUrl64 = Global.clashMetaCoreUrl + "/download/{0}/Clash.Meta-windows-amd64-compatible-{0}.zip",
match = "v",
versionArg = "-v",
redirectInfo = true,
}); });
coreInfos.Add(new CoreInfo coreInfos.Add(new CoreInfo
{ {
coreType = ECoreType.hysteria, coreType = ECoreType.hysteria,
coreExes = new List<string> { "hysteria-tun-windows-6.0-amd64", "hysteria-tun-windows-6.0-386", "hysteria" }, coreExes = new List<string> { "hysteria-windows-amd64", "hysteria-windows-386", "hysteria" },
arguments = "", arguments = "",
coreUrl = Global.hysteriaCoreUrl coreUrl = Global.hysteriaCoreUrl,
coreReleaseApiUrl = Global.hysteriaCoreUrl.Replace(@"https://github.com", @"https://api.github.com/repos"),
coreDownloadUrl32 = Global.hysteriaCoreUrl + "/download/{0}/hysteria-windows-386.exe",
coreDownloadUrl64 = Global.hysteriaCoreUrl + "/download/{0}/hysteria-windows-amd64.exe",
redirectInfo = true,
});
coreInfos.Add(new CoreInfo
{
coreType = ECoreType.naiveproxy,
coreExes = new List<string> { "naiveproxy", "naive" },
arguments = "config.json",
coreUrl = Global.naiveproxyCoreUrl,
redirectInfo = false,
});
coreInfos.Add(new CoreInfo
{
coreType = ECoreType.tuic,
coreExes = new List<string> { "tuic-client", "tuic" },
arguments = "-c config.json",
coreUrl = Global.tuicCoreUrl,
redirectInfo = true,
});
coreInfos.Add(new CoreInfo
{
coreType = ECoreType.sing_box,
coreExes = new List<string> { "sing-box-client", "sing-box" },
arguments = "run",
coreUrl = Global.singboxCoreUrl,
redirectInfo = true,
}); });
} }

View File

@@ -24,20 +24,65 @@ namespace v2rayN.Handler
//private List<int> _selecteds; //private List<int> _selecteds;
//private Thread _workThread; //private Thread _workThread;
//Action<int, string> _updateFunc; //Action<int, string> _updateFunc;
public static MainFormHandler Instance public static MainFormHandler Instance => instance.Value;
{
get { return instance.Value; }
}
public Icon GetNotifyIcon(Config config, Icon def) public Icon GetNotifyIcon(Config config, Icon def)
{ {
try try
{ {
int index = (int)config.sysProxyType;
//Load from routing setting
var createdIcon = GetNotifyIcon4Routing(config);
if (createdIcon != null)
{
return createdIcon;
}
//Load from local file
var fileName = Utils.GetPath($"NotifyIcon{index + 1}.ico");
if (File.Exists(fileName))
{
return new Icon(fileName);
}
switch (index)
{
case 0:
return Properties.Resources.NotifyIcon1;
case 1:
return Properties.Resources.NotifyIcon2;
case 2:
return Properties.Resources.NotifyIcon3;
}
return Properties.Resources.NotifyIcon1;
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
return def;
}
}
private Icon GetNotifyIcon4Routing(Config config)
{
try
{
if (!config.enableRoutingAdvanced)
{
return null;
}
var item = config.routings[config.routingIndex];
if (Utils.IsNullOrEmpty(item.customIcon) || !File.Exists(item.customIcon))
{
return null;
}
Color color = ColorTranslator.FromHtml("#3399CC"); Color color = ColorTranslator.FromHtml("#3399CC");
int index = (int)config.sysProxyType; int index = (int)config.sysProxyType;
if (index > 0) if (index > 0)
{ {
color = (new Color[] { Color.Red, Color.Purple, Color.DarkGreen, Color.Orange, Color.DarkSlateBlue, Color.RoyalBlue })[index - 1]; color = (new[] { Color.Red, Color.Purple, Color.DarkGreen, Color.Orange, Color.DarkSlateBlue, Color.RoyalBlue })[index - 1];
//color = ColorTranslator.FromHtml(new string[] { "#CC0066", "#CC6600", "#99CC99", "#666699" }[index - 1]);
} }
int width = 128; int width = 128;
@@ -47,23 +92,10 @@ namespace v2rayN.Handler
Graphics graphics = Graphics.FromImage(bitmap); Graphics graphics = Graphics.FromImage(bitmap);
SolidBrush drawBrush = new SolidBrush(color); SolidBrush drawBrush = new SolidBrush(color);
var customIcon = false; graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
if (config.enableRoutingAdvanced) //graphics.FillRectangle(drawBrush, new Rectangle(0, 0, width, height));
{ graphics.DrawImage(new Bitmap(item.customIcon), 0, 0, width, height);
var item = config.routings[config.routingIndex]; graphics.FillEllipse(drawBrush, width / 2, width / 2, width / 2, width / 2);
if (!Utils.IsNullOrEmpty(item.customIcon) && File.Exists(item.customIcon))
{
graphics.FillRectangle(drawBrush, new Rectangle(0, 0, width, height));
graphics.DrawImage(new Bitmap(item.customIcon), 0, 0, width, height);
customIcon = true;
}
}
if (!customIcon)
{
graphics.FillEllipse(drawBrush, new Rectangle(0, 0, width, height));
int zoom = 16;
graphics.DrawImage(new Bitmap(Properties.Resources.notify, width - zoom, width - zoom), zoom / 2, zoom / 2);
}
Icon createdIcon = Icon.FromHandle(bitmap.GetHicon()); Icon createdIcon = Icon.FromHandle(bitmap.GetHicon());
@@ -76,7 +108,7 @@ namespace v2rayN.Handler
catch (Exception ex) catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex); Utils.SaveLog(ex.Message, ex);
return def; return null;
} }
} }
@@ -86,8 +118,7 @@ namespace v2rayN.Handler
{ {
return; return;
} }
if (item.configType != EConfigType.Vmess if (item.configType == EConfigType.Custom)
&& item.configType != EConfigType.VLESS)
{ {
UI.Show(ResUI.NonVmessService); UI.Show(ResUI.NonVmessService);
return; return;
@@ -126,7 +157,7 @@ namespace v2rayN.Handler
{ {
return; return;
} }
if (item.configType != EConfigType.Vmess if (item.configType != EConfigType.VMess
&& item.configType != EConfigType.VLESS) && item.configType != EConfigType.VLESS)
{ {
UI.Show(ResUI.NonVmessService); UI.Show(ResUI.NonVmessService);
@@ -201,6 +232,46 @@ namespace v2rayN.Handler
} }
} }
public bool RestoreGuiNConfig(ref Config config)
{
var fileContent = string.Empty;
using (OpenFileDialog fileDialog = new OpenFileDialog())
{
fileDialog.InitialDirectory = Utils.GetBackupPath("");
fileDialog.Filter = "guiNConfig|*.json|All|*.*";
fileDialog.FilterIndex = 2;
fileDialog.RestoreDirectory = true;
if (fileDialog.ShowDialog() == DialogResult.OK)
{
fileContent = Utils.LoadResource(fileDialog.FileName);
}
else
{
return false;
}
}
if (Utils.IsNullOrEmpty(fileContent))
{
UI.ShowWarning(ResUI.OperationFailed);
return false;
}
var resConfig = Utils.FromJson<Config>(fileContent);
if (resConfig == null)
{
UI.ShowWarning(ResUI.OperationFailed);
return false;
}
//backup first
BackupGuiNConfig(config, true);
config = resConfig;
LazyConfig.Instance.SetConfig(ref config);
return true;
}
public void UpdateTask(Config config, Action<bool, string> update) public void UpdateTask(Config config, Action<bool, string> update)
{ {
Task.Run(() => UpdateTaskRun(config, update)); Task.Run(() => UpdateTaskRun(config, update));
@@ -208,40 +279,54 @@ namespace v2rayN.Handler
private void UpdateTaskRun(Config config, Action<bool, string> update) private void UpdateTaskRun(Config config, Action<bool, string> update)
{ {
var autoUpdateSubTime = DateTime.Now;
var autoUpdateGeoTime = DateTime.Now;
Thread.Sleep(60000);
Utils.SaveLog("UpdateTaskRun");
var updateHandle = new UpdateHandle(); var updateHandle = new UpdateHandle();
while (true) while (true)
{ {
Thread.Sleep(60000); var dtNow = DateTime.Now;
if (config.autoUpdateInterval <= 0)
if (config.autoUpdateSubInterval > 0)
{ {
continue; if ((dtNow - autoUpdateSubTime).Hours % config.autoUpdateSubInterval == 0)
{
updateHandle.UpdateSubscriptionProcess(config, "", true, (bool success, string msg) =>
{
update(success, msg);
if (success)
Utils.SaveLog("subscription" + msg);
});
autoUpdateSubTime = dtNow;
}
Thread.Sleep(60000);
} }
Utils.SaveLog("UpdateTaskRun");
updateHandle.UpdateSubscriptionProcess(config, true, (bool success, string msg) => if (config.autoUpdateInterval > 0)
{ {
update(success, msg); if ((dtNow - autoUpdateGeoTime).Hours % config.autoUpdateInterval == 0)
if (success) {
Utils.SaveLog("subscription" + msg); updateHandle.UpdateGeoFile("geosite", config, (bool success, string msg) =>
}); {
update(false, msg);
if (success)
Utils.SaveLog("geosite" + msg);
});
Thread.Sleep(60000); updateHandle.UpdateGeoFile("geoip", config, (bool success, string msg) =>
{
update(false, msg);
if (success)
Utils.SaveLog("geoip" + msg);
});
autoUpdateGeoTime = dtNow;
}
}
updateHandle.UpdateGeoFile("geosite", config, (bool success, string msg) => Thread.Sleep(1000 * 3600);
{
update(false, msg);
if (success)
Utils.SaveLog("geosite" + msg);
});
updateHandle.UpdateGeoFile("geoip", config, (bool success, string msg) =>
{
update(false, msg);
if (success)
Utils.SaveLog("geoip" + msg);
});
Thread.Sleep(1000 * 3600 * config.autoUpdateInterval);
} }
} }

View File

@@ -1,4 +1,5 @@
using System.Drawing; using System;
using System.Drawing;
using ZXing; using ZXing;
using ZXing.QrCode; using ZXing.QrCode;
@@ -34,8 +35,9 @@ namespace v2rayN.Handler
img = (Image)bmp; img = (Image)bmp;
return img; return img;
} }
catch catch(Exception ex)
{ {
Utils.SaveLog(ex.Message, ex);
return img; return img;
} }
} }

View File

@@ -31,7 +31,7 @@ namespace v2rayN.Handler
switch (item.configType) switch (item.configType)
{ {
case EConfigType.Vmess: case EConfigType.VMess:
url = ShareVmess(item); url = ShareVmess(item);
break; break;
case EConfigType.Shadowsocks: case EConfigType.Shadowsocks:
@@ -51,8 +51,9 @@ namespace v2rayN.Handler
} }
return url; return url;
} }
catch catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex);
return ""; return "";
} }
} }
@@ -81,7 +82,7 @@ namespace v2rayN.Handler
url = Utils.ToJson(vmessQRCode); url = Utils.ToJson(vmessQRCode);
url = Utils.Base64Encode(url); url = Utils.Base64Encode(url);
url = string.Format("{0}{1}", Global.vmessProtocol, url); url = $"{Global.vmessProtocol}{url}";
return url; return url;
} }
@@ -104,7 +105,7 @@ namespace v2rayN.Handler
//new Sip002 //new Sip002
var pw = Utils.Base64Encode($"{item.security}:{item.id}"); var pw = Utils.Base64Encode($"{item.security}:{item.id}");
url = $"{pw}@{GetIpv6(item.address)}:{ item.port}"; url = $"{pw}@{GetIpv6(item.address)}:{ item.port}";
url = string.Format("{0}{1}{2}", Global.ssProtocol, url, remark); url = $"{Global.ssProtocol}{url}{remark}";
return url; return url;
} }
@@ -125,7 +126,7 @@ namespace v2rayN.Handler
//new //new
var pw = Utils.Base64Encode($"{item.security}:{item.id}"); var pw = Utils.Base64Encode($"{item.security}:{item.id}");
url = $"{pw}@{GetIpv6(item.address)}:{ item.port}"; url = $"{pw}@{GetIpv6(item.address)}:{ item.port}";
url = string.Format("{0}{1}{2}", Global.socksProtocol, url, remark); url = $"{Global.socksProtocol}{url}{remark}";
return url; return url;
} }
@@ -145,7 +146,7 @@ namespace v2rayN.Handler
item.id, item.id,
GetIpv6(item.address), GetIpv6(item.address),
item.port); item.port);
url = string.Format("{0}{1}{2}{3}", Global.trojanProtocol, url, query, remark); url = $"{Global.trojanProtocol}{url}{query}{remark}";
return url; return url;
} }
@@ -173,7 +174,7 @@ namespace v2rayN.Handler
item.id, item.id,
GetIpv6(item.address), GetIpv6(item.address),
item.port); item.port);
url = string.Format("{0}{1}{2}{3}", Global.vlessProtocol, url, query, remark); url = $"{Global.vlessProtocol}{url}{query}{remark}";
return url; return url;
} }
private static string GetIpv6(string address) private static string GetIpv6(string address)
@@ -207,40 +208,20 @@ namespace v2rayN.Handler
{ {
dicQuery.Add("alpn", Utils.UrlEncode(Utils.List2String(item.alpn))); dicQuery.Add("alpn", Utils.UrlEncode(Utils.List2String(item.alpn)));
} }
if (!Utils.IsNullOrEmpty(item.network))
{ dicQuery.Add("type", !Utils.IsNullOrEmpty(item.network) ? item.network : "tcp");
dicQuery.Add("type", item.network);
}
else
{
dicQuery.Add("type", "tcp");
}
switch (item.network) switch (item.network)
{ {
case "tcp": case "tcp":
if (!Utils.IsNullOrEmpty(item.headerType)) dicQuery.Add("headerType", !Utils.IsNullOrEmpty(item.headerType) ? item.headerType : "none");
{
dicQuery.Add("headerType", item.headerType);
}
else
{
dicQuery.Add("headerType", "none");
}
if (!Utils.IsNullOrEmpty(item.requestHost)) if (!Utils.IsNullOrEmpty(item.requestHost))
{ {
dicQuery.Add("host", Utils.UrlEncode(item.requestHost)); dicQuery.Add("host", Utils.UrlEncode(item.requestHost));
} }
break; break;
case "kcp": case "kcp":
if (!Utils.IsNullOrEmpty(item.headerType)) dicQuery.Add("headerType", !Utils.IsNullOrEmpty(item.headerType) ? item.headerType : "none");
{
dicQuery.Add("headerType", item.headerType);
}
else
{
dicQuery.Add("headerType", "none");
}
if (!Utils.IsNullOrEmpty(item.path)) if (!Utils.IsNullOrEmpty(item.path))
{ {
dicQuery.Add("seed", Utils.UrlEncode(item.path)); dicQuery.Add("seed", Utils.UrlEncode(item.path));
@@ -272,14 +253,7 @@ namespace v2rayN.Handler
break; break;
case "quic": case "quic":
if (!Utils.IsNullOrEmpty(item.headerType)) dicQuery.Add("headerType", !Utils.IsNullOrEmpty(item.headerType) ? item.headerType : "none");
{
dicQuery.Add("headerType", item.headerType);
}
else
{
dicQuery.Add("headerType", "none");
}
dicQuery.Add("quicSecurity", Utils.UrlEncode(item.requestHost)); dicQuery.Add("quicSecurity", Utils.UrlEncode(item.requestHost));
dicQuery.Add("key", Utils.UrlEncode(item.path)); dicQuery.Add("key", Utils.UrlEncode(item.path));
break; break;
@@ -341,11 +315,7 @@ namespace v2rayN.Handler
{ {
msg = ResUI.ConfigurationFormatIncorrect; msg = ResUI.ConfigurationFormatIncorrect;
vmessItem = ResolveSSLegacy(result); vmessItem = ResolveSSLegacy(result) ?? ResolveSip002(result);
if (vmessItem == null)
{
vmessItem = ResolveSip002(result);
}
if (vmessItem == null) if (vmessItem == null)
{ {
return null; return null;
@@ -361,11 +331,7 @@ namespace v2rayN.Handler
{ {
msg = ResUI.ConfigurationFormatIncorrect; msg = ResUI.ConfigurationFormatIncorrect;
vmessItem = ResolveSocksNew(result); vmessItem = ResolveSocksNew(result) ?? ResolveSocks(result);
if (vmessItem == null)
{
vmessItem = ResolveSocks(result);
}
if (vmessItem == null) if (vmessItem == null)
{ {
return null; return null;
@@ -395,8 +361,9 @@ namespace v2rayN.Handler
return null; return null;
} }
} }
catch catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex);
msg = ResUI.Incorrectconfiguration; msg = ResUI.Incorrectconfiguration;
return null; return null;
} }
@@ -407,9 +374,11 @@ namespace v2rayN.Handler
private static VmessItem ResolveVmess(string result, out string msg) private static VmessItem ResolveVmess(string result, out string msg)
{ {
msg = string.Empty; msg = string.Empty;
VmessItem vmessItem = new VmessItem(); var vmessItem = new VmessItem
{
configType = EConfigType.VMess
};
vmessItem.configType = EConfigType.Vmess;
result = result.Substring(Global.vmessProtocol.Length); result = result.Substring(Global.vmessProtocol.Length);
result = Utils.Base64Decode(result); result = Utils.Base64Decode(result);
@@ -432,14 +401,7 @@ namespace v2rayN.Handler
vmessItem.alterId = Utils.ToInt(vmessQRCode.aid); vmessItem.alterId = Utils.ToInt(vmessQRCode.aid);
vmessItem.security = Utils.ToString(vmessQRCode.scy); vmessItem.security = Utils.ToString(vmessQRCode.scy);
if (!Utils.IsNullOrEmpty(vmessQRCode.scy)) vmessItem.security = !Utils.IsNullOrEmpty(vmessQRCode.scy) ? vmessQRCode.scy : Global.DefaultSecurity;
{
vmessItem.security = vmessQRCode.scy;
}
else
{
vmessItem.security = Global.DefaultSecurity;
}
if (!Utils.IsNullOrEmpty(vmessQRCode.net)) if (!Utils.IsNullOrEmpty(vmessQRCode.net))
{ {
vmessItem.network = vmessQRCode.net; vmessItem.network = vmessQRCode.net;
@@ -462,7 +424,7 @@ namespace v2rayN.Handler
{ {
VmessItem vmessItem = new VmessItem VmessItem vmessItem = new VmessItem
{ {
configType = EConfigType.Vmess configType = EConfigType.VMess
}; };
result = result.Substring(Global.vmessProtocol.Length); result = result.Substring(Global.vmessProtocol.Length);
int indexSplit = result.IndexOf("?"); int indexSplit = result.IndexOf("?");
@@ -500,7 +462,7 @@ namespace v2rayN.Handler
{ {
VmessItem i = new VmessItem VmessItem i = new VmessItem
{ {
configType = EConfigType.Vmess, configType = EConfigType.VMess,
security = "auto" security = "auto"
}; };
@@ -594,22 +556,47 @@ namespace v2rayN.Handler
address = parsedUrl.IdnHost, address = parsedUrl.IdnHost,
port = parsedUrl.Port, port = parsedUrl.Port,
}; };
// parse base64 UserInfo
string rawUserInfo = parsedUrl.GetComponents(UriComponents.UserInfo, UriFormat.UriEscaped); string rawUserInfo = parsedUrl.GetComponents(UriComponents.UserInfo, UriFormat.UriEscaped);
string userInfo = Utils.Base64Decode(rawUserInfo); //2022-blake3
string[] userInfoParts = userInfo.Split(new char[] { ':' }, 2); if (rawUserInfo.Contains(":"))
if (userInfoParts.Length != 2)
{ {
return null; string[] userInfoParts = rawUserInfo.Split(new[] { ':' }, 2);
if (userInfoParts.Length != 2)
{
return null;
}
server.security = userInfoParts[0];
server.id = Utils.UrlDecode(userInfoParts[1]);
}
else
{
// parse base64 UserInfo
string userInfo = Utils.Base64Decode(rawUserInfo);
string[] userInfoParts = userInfo.Split(new[] { ':' }, 2);
if (userInfoParts.Length != 2)
{
return null;
}
server.security = userInfoParts[0];
server.id = userInfoParts[1];
} }
server.security = userInfoParts[0];
server.id = userInfoParts[1];
NameValueCollection queryParameters = HttpUtility.ParseQueryString(parsedUrl.Query); NameValueCollection queryParameters = HttpUtility.ParseQueryString(parsedUrl.Query);
if (queryParameters["plugin"] != null) if (queryParameters["plugin"] != null)
{ {
return null; //obfs-host exists
var obfsHost = queryParameters["plugin"].Split(';').FirstOrDefault(t => t.Contains("obfs-host"));
if (queryParameters["plugin"].Contains("obfs=http") && !Utils.IsNullOrEmpty(obfsHost))
{
obfsHost = obfsHost.Replace("obfs-host=", "");
server.network = Global.DefaultNetwork;
server.headerType = Global.TcpHeaderHttp;
server.requestHost = obfsHost;
}
else
{
return null;
}
} }
return server; return server;
@@ -655,8 +642,10 @@ namespace v2rayN.Handler
private static VmessItem ResolveSocks(string result) private static VmessItem ResolveSocks(string result)
{ {
VmessItem vmessItem = new VmessItem(); VmessItem vmessItem = new VmessItem
vmessItem.configType = EConfigType.Socks; {
configType = EConfigType.Socks
};
result = result.Substring(Global.socksProtocol.Length); result = result.Substring(Global.socksProtocol.Length);
//remark //remark
int indexRemark = result.IndexOf("#"); int indexRemark = result.IndexOf("#");
@@ -720,7 +709,7 @@ namespace v2rayN.Handler
// parse base64 UserInfo // parse base64 UserInfo
string rawUserInfo = parsedUrl.GetComponents(UriComponents.UserInfo, UriFormat.Unescaped); string rawUserInfo = parsedUrl.GetComponents(UriComponents.UserInfo, UriFormat.Unescaped);
string userInfo = Utils.Base64Decode(rawUserInfo); string userInfo = Utils.Base64Decode(rawUserInfo);
string[] userInfoParts = userInfo.Split(new char[] { ':' }, 2); string[] userInfoParts = userInfo.Split(new[] { ':' }, 2);
if (userInfoParts.Length == 2) if (userInfoParts.Length == 2)
{ {
server.security = userInfoParts[0]; server.security = userInfoParts[0];

View File

@@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq;
using System.Net; using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using System.Threading; using System.Threading;
@@ -43,19 +44,19 @@ namespace v2rayN.Handler
if (actionType == ESpeedActionType.Ping) if (actionType == ESpeedActionType.Ping)
{ {
Task.Run(() => RunPing()); Task.Run(RunPing);
} }
else if (actionType == ESpeedActionType.Tcping) else if (actionType == ESpeedActionType.Tcping)
{ {
Task.Run(() => RunTcping()); Task.Run(RunTcping);
} }
else if (actionType == ESpeedActionType.Realping) else if (actionType == ESpeedActionType.Realping)
{ {
Task.Run(() => RunRealPing()); Task.Run(RunRealPing);
} }
else if (actionType == ESpeedActionType.Speedtest) else if (actionType == ESpeedActionType.Speedtest)
{ {
Task.Run(() => RunSpeedTestAsync()); Task.Run(RunSpeedTestAsync);
} }
} }
@@ -63,12 +64,8 @@ namespace v2rayN.Handler
{ {
try try
{ {
foreach (var it in _selecteds) foreach (var it in _selecteds.Where(it => it.configType != EConfigType.Custom))
{ {
if (it.configType == EConfigType.Custom)
{
continue;
}
try try
{ {
Task.Run(() => updateFun(it)); Task.Run(() => updateFun(it));
@@ -187,7 +184,7 @@ namespace v2rayN.Handler
}; };
downloadHandle2.Error += (sender2, args) => downloadHandle2.Error += (sender2, args) =>
{ {
_updateFunc("", args.GetException().Message); _updateFunc(testIndexId, args.GetException().Message);
}; };
var timeout = 8; var timeout = 8;
@@ -252,7 +249,7 @@ namespace v2rayN.Handler
{ {
return "Timeout"; return "Timeout";
} }
return string.Format("{0}{1}", time, unit).PadLeft(8, ' '); return $"{time}{unit}".PadLeft(8, ' ');
} }
} }
} }

View File

@@ -31,13 +31,7 @@ namespace v2rayN.Handler
} }
public List<ServerStatItem> Statistic public List<ServerStatItem> Statistic => serverStatistics_.server;
{
get
{
return serverStatistics_.server;
}
}
public StatisticsHandler(Mode.Config config, Action<ulong, ulong, List<ServerStatItem>> update) public StatisticsHandler(Mode.Config config, Action<ulong, ulong, List<ServerStatItem>> update)
{ {
@@ -68,7 +62,7 @@ namespace v2rayN.Handler
GrpcInit(); GrpcInit();
Task.Run(() => Run()); Task.Run(Run);
} }
private void GrpcInit() private void GrpcInit()
@@ -133,7 +127,8 @@ namespace v2rayN.Handler
} }
} }
} }
Thread.Sleep(config_.statisticsFreshRate); var sleep = config_.statisticsFreshRate < 1 ? 1 : config_.statisticsFreshRate;
Thread.Sleep(1000 * sleep);
channel_.ConnectAsync(); channel_.ConnectAsync();
} }
catch (Exception ex) catch (Exception ex)
@@ -196,15 +191,16 @@ namespace v2rayN.Handler
{ {
if (serverStatistics_ != null) if (serverStatistics_ != null)
{ {
foreach (var item in serverStatistics_.server) //foreach (var item in serverStatistics_.server)
{ //{
item.todayUp = 0; // item.todayUp = 0;
item.todayDown = 0; // item.todayDown = 0;
item.totalUp = 0; // item.totalUp = 0;
item.totalDown = 0; // item.totalDown = 0;
// update ui display to zero // // update ui display to zero
updateFunc_(0, 0, new List<ServerStatItem> { item }); // updateFunc_(0, 0, new List<ServerStatItem> { item });
} //}
serverStatistics_.server = new List<ServerStatItem>();
// update statistic json file // update statistic json file
SaveToFile(); SaveToFile();

View File

@@ -59,7 +59,8 @@ namespace v2rayN.Handler
try try
{ {
int port = config.GetLocalPort(Global.InboundHttp2); int port = config.GetLocalPort(Global.InboundHttp);
int portSocks = config.GetLocalPort(Global.InboundSocks);
if (port <= 0) if (port <= 0)
{ {
return false; return false;
@@ -67,7 +68,20 @@ namespace v2rayN.Handler
if (type == ESysProxyType.ForcedChange) if (type == ESysProxyType.ForcedChange)
{ {
var strExceptions = $"{config.constItem.defIEProxyExceptions};{config.systemProxyExceptions}"; var strExceptions = $"{config.constItem.defIEProxyExceptions};{config.systemProxyExceptions}";
SetIEProxy(true, $"{Global.Loopback}:{port}", strExceptions);
var strProxy = string.Empty;
if (Utils.IsNullOrEmpty(config.systemProxyAdvancedProtocol))
{
strProxy = $"{Global.Loopback}:{port}";
}
else
{
strProxy = config.systemProxyAdvancedProtocol
.Replace("{ip}", Global.Loopback)
.Replace("{http_port}", port.ToString())
.Replace("{socks_port}", portSocks.ToString());
}
SetIEProxy(true, strProxy, strExceptions);
} }
else if (type == ESysProxyType.ForcedClear) else if (type == ESysProxyType.ForcedClear)
{ {
@@ -96,41 +110,6 @@ namespace v2rayN.Handler
} }
} }
public static void SetIEProxy(bool enable, bool global, string strProxy)
{
//Read();
//if (!_userSettings.UserSettingsRecorded)
//{
// // record user settings
// ExecSysproxy("query");
// //ParseQueryStr(_queryStr);
//}
string arguments;
if (enable)
{
arguments = global
? $"global {strProxy} {Global.IEProxyExceptions}"
: $"pac {strProxy}";
}
else
{
// restore user settings
string flags = _userSettings.Flags;
string proxy_server = _userSettings.ProxyServer ?? "-";
string bypass_list = _userSettings.BypassList ?? "-";
string pac_url = _userSettings.PacUrl ?? "-";
arguments = $"set {flags} {proxy_server} {bypass_list} {pac_url}";
// have to get new settings
_userSettings.UserSettingsRecorded = false;
}
//Save();
ExecSysproxy(arguments);
}
public static void SetIEProxy(bool global, string strProxy, string strExceptions) public static void SetIEProxy(bool global, string strProxy, string strExceptions)
{ {

View File

@@ -1,10 +1,14 @@
using System; using System;
using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using Newtonsoft.Json;
using v2rayN.Base; using v2rayN.Base;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Resx; using v2rayN.Resx;
@@ -25,20 +29,12 @@ namespace v2rayN.Handler
public ResultEventArgs(bool success, string msg) public ResultEventArgs(bool success, string msg)
{ {
this.Success = success; Success = success;
this.Msg = msg; Msg = msg;
} }
} }
private readonly string nLatestUrl = Global.NUrl + "/latest"; public void CheckUpdateGuiN(Config config, Action<bool, string> update, bool preRelease)
private const string nUrl = Global.NUrl + "/download/{0}/v2rayN.zip";
private readonly string v2flyCoreLatestUrl = Global.v2flyCoreUrl + "/latest";
private const string v2flyCoreUrl = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip";
private readonly string xrayCoreLatestUrl = Global.xrayCoreUrl + "/latest";
private const string xrayCoreUrl = Global.xrayCoreUrl + "/download/{0}/Xray-windows-{1}.zip";
private const string geoUrl = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/{0}.dat";
public void CheckUpdateGuiN(Config config, Action<bool, string> update)
{ {
_config = config; _config = config;
_updateFunc = update; _updateFunc = update;
@@ -104,11 +100,11 @@ namespace v2rayN.Handler
} }
}; };
_updateFunc(false, string.Format(ResUI.MsgStartUpdating, "v2rayN")); _updateFunc(false, string.Format(ResUI.MsgStartUpdating, "v2rayN"));
CheckUpdateAsync(ECoreType.v2rayN); CheckUpdateAsync(ECoreType.v2rayN, preRelease);
} }
public void CheckUpdateCore(ECoreType type, Config config, Action<bool, string> update) public void CheckUpdateCore(ECoreType type, Config config, Action<bool, string> update, bool preRelease)
{ {
_config = config; _config = config;
_updateFunc = update; _updateFunc = update;
@@ -159,11 +155,11 @@ namespace v2rayN.Handler
} }
}; };
_updateFunc(false, string.Format(ResUI.MsgStartUpdating, "Core")); _updateFunc(false, string.Format(ResUI.MsgStartUpdating, "Core"));
CheckUpdateAsync(type); CheckUpdateAsync(type, preRelease);
} }
public void UpdateSubscriptionProcess(Config config, bool blProxy, Action<bool, string> update) public void UpdateSubscriptionProcess(Config config, string groupId, bool blProxy, Action<bool, string> update)
{ {
_config = config; _config = config;
_updateFunc = update; _updateFunc = update;
@@ -178,16 +174,31 @@ namespace v2rayN.Handler
Task.Run(async () => Task.Run(async () =>
{ {
//Turn off system proxy
bool bSysProxyType = false;
if (!blProxy && config.sysProxyType == ESysProxyType.ForcedChange)
{
bSysProxyType = true;
config.sysProxyType = ESysProxyType.ForcedClear;
SysProxyHandle.UpdateSysProxy(config, false);
Thread.Sleep(3000);
}
foreach (var item in config.subItem) foreach (var item in config.subItem)
{ {
if (item.enabled == false) if (item.enabled == false)
{ {
continue; continue;
} }
if (!Utils.IsNullOrEmpty(groupId) && item.groupId != groupId)
{
continue;
}
string id = item.id.TrimEx(); string id = item.id.TrimEx();
string url = item.url.TrimEx(); string url = item.url.TrimEx();
string userAgent = item.userAgent.TrimEx(); string userAgent = item.userAgent.TrimEx();
string groupId = item.groupId.TrimEx(); //string groupId = item.groupId.TrimEx();
string hashCode = $"{item.remarks}->"; string hashCode = $"{item.remarks}->";
if (Utils.IsNullOrEmpty(id) || Utils.IsNullOrEmpty(url)) if (Utils.IsNullOrEmpty(id) || Utils.IsNullOrEmpty(url))
{ {
@@ -195,29 +206,47 @@ namespace v2rayN.Handler
continue; continue;
} }
_updateFunc(false, $"{hashCode}{ResUI.MsgStartGettingSubscriptions}"); var downloadHandle = new DownloadHandle();
var result = await (new DownloadHandle()).DownloadStringAsync(url, blProxy, userAgent); downloadHandle.Error += (sender2, args) =>
{
_updateFunc(false, $"{hashCode}{args.GetException().Message}");
};
_updateFunc(false, $"{hashCode}{ResUI.MsgStartGettingSubscriptions}");
var result = await downloadHandle.DownloadStringAsync(url, blProxy, userAgent);
if (blProxy && Utils.IsNullOrEmpty(result))
{
result = await downloadHandle.DownloadStringAsync(url, false, userAgent);
}
_updateFunc(false, $"{hashCode}{ResUI.MsgGetSubscriptionSuccessfully}");
if (Utils.IsNullOrEmpty(result)) if (Utils.IsNullOrEmpty(result))
{ {
_updateFunc(false, $"{hashCode}{ResUI.MsgSubscriptionDecodingFailed}"); _updateFunc(false, $"{hashCode}{ResUI.MsgSubscriptionDecodingFailed}");
} }
else else
{ {
int ret = ConfigHandler.AddBatchServers(ref config, result, id, groupId); _updateFunc(false, $"{hashCode}{ResUI.MsgGetSubscriptionSuccessfully}");
if (ret > 0) if (result.Length < 99)
{ {
_updateFunc(false, $"{hashCode}{ResUI.MsgUpdateSubscriptionEnd}"); _updateFunc(false, $"{hashCode}{result}");
}
else
{
_updateFunc(false, $"{hashCode}{ResUI.MsgFailedImportSubscription}");
} }
int ret = ConfigHandler.AddBatchServers(ref config, result, id, item.groupId.TrimEx());
_updateFunc(false,
ret > 0
? $"{hashCode}{ResUI.MsgUpdateSubscriptionEnd}"
: $"{hashCode}{ResUI.MsgFailedImportSubscription}");
} }
_updateFunc(false, $"-------------------------------------------------------"); _updateFunc(false, "-------------------------------------------------------");
}
//restore system proxy
if (bSysProxyType)
{
config.sysProxyType = ESysProxyType.ForcedChange;
SysProxyHandle.UpdateSysProxy(config, false);
} }
_updateFunc(true, $"{ResUI.MsgUpdateSubscriptionEnd}"); _updateFunc(true, $"{ResUI.MsgUpdateSubscriptionEnd}");
}); });
} }
@@ -226,7 +255,7 @@ namespace v2rayN.Handler
{ {
_config = config; _config = config;
_updateFunc = update; _updateFunc = update;
var url = string.Format(geoUrl, geoName); var url = string.Format(Global.geoUrl, geoName);
DownloadHandle downloadHandle = null; DownloadHandle downloadHandle = null;
if (downloadHandle == null) if (downloadHandle == null)
@@ -250,8 +279,8 @@ namespace v2rayN.Handler
File.Delete(targetPath); File.Delete(targetPath);
} }
File.Move(fileName, targetPath); File.Move(fileName, targetPath);
//_updateFunc(true, ""); //_updateFunc(true, "");
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -272,34 +301,29 @@ namespace v2rayN.Handler
} }
public void RunAvailabilityCheck(Action<bool, string> update)
{
Task.Run(() =>
{
var time = (new DownloadHandle()).RunAvailabilityCheck(null);
update(false, string.Format(ResUI.TestMeOutput, time));
});
}
#region private #region private
private async void CheckUpdateAsync(ECoreType type) private async void CheckUpdateAsync(ECoreType type, bool preRelease)
{ {
try try
{ {
string url; var coreInfo = LazyConfig.Instance.GetCoreInfo(type);
if (type == ECoreType.v2fly) string url = coreInfo.coreReleaseApiUrl;
{
url = v2flyCoreLatestUrl;
}
else if (type == ECoreType.Xray)
{
url = xrayCoreLatestUrl;
}
else if (type == ECoreType.v2rayN)
{
url = nLatestUrl;
}
else
{
throw new ArgumentException("Type");
}
var result = await (new DownloadHandle()).UrlRedirectAsync(url, true); var result = await (new DownloadHandle()).DownloadStringAsync(url, true, "");
if (!Utils.IsNullOrEmpty(result)) if (!Utils.IsNullOrEmpty(result))
{ {
responseHandler(type, result); responseHandler(type, result, preRelease);
} }
else else
{ {
@@ -326,7 +350,7 @@ namespace v2rayN.Handler
string filePath = string.Empty; string filePath = string.Empty;
foreach (string name in coreInfo.coreExes) foreach (string name in coreInfo.coreExes)
{ {
string vName = string.Format("{0}.exe", name); string vName = $"{name}.exe";
vName = Utils.GetPath(vName); vName = Utils.GetPath(vName);
if (File.Exists(vName)) if (File.Exists(vName))
{ {
@@ -337,14 +361,14 @@ namespace v2rayN.Handler
if (!File.Exists(filePath)) if (!File.Exists(filePath))
{ {
string msg = string.Format(ResUI.NotFoundCore, @""); string msg = string.Format(ResUI.NotFoundCore, @"", "");
//ShowMsg(true, msg); //ShowMsg(true, msg);
return ""; return "";
} }
Process p = new Process(); Process p = new Process();
p.StartInfo.FileName = filePath; p.StartInfo.FileName = filePath;
p.StartInfo.Arguments = "-version"; p.StartInfo.Arguments = coreInfo.versionArg;
p.StartInfo.WorkingDirectory = Utils.StartupPath(); p.StartInfo.WorkingDirectory = Utils.StartupPath();
p.StartInfo.UseShellExecute = false; p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true; p.StartInfo.RedirectStandardOutput = true;
@@ -353,7 +377,20 @@ namespace v2rayN.Handler
p.Start(); p.Start();
p.WaitForExit(5000); p.WaitForExit(5000);
string echo = p.StandardOutput.ReadToEnd(); string echo = p.StandardOutput.ReadToEnd();
string version = Regex.Match(echo, $"{coreInfo.match} ([0-9.]+) \\(").Groups[1].Value; string version = string.Empty;
switch (type)
{
case ECoreType.v2fly:
case ECoreType.SagerNet:
case ECoreType.Xray:
case ECoreType.v2fly_v5:
version = Regex.Match(echo, $"{coreInfo.match} ([0-9.]+) \\(").Groups[1].Value;
break;
case ECoreType.clash:
case ECoreType.clash_meta:
version = Regex.Match(echo, $"v[0-9.]+").Groups[0].Value;
break;
}
return version; return version;
} }
catch (Exception ex) catch (Exception ex)
@@ -363,41 +400,65 @@ namespace v2rayN.Handler
return ""; return "";
} }
} }
private void responseHandler(ECoreType type, string redirectUrl) private void responseHandler(ECoreType type, string gitHubReleaseApi, bool preRelease)
{ {
try try
{ {
string version = redirectUrl.Substring(redirectUrl.LastIndexOf("/", StringComparison.Ordinal) + 1); var gitHubReleases = Utils.FromJson<List<GitHubRelease>>(gitHubReleaseApi);
string version;
if (preRelease)
{
version = gitHubReleases!.First().TagName;
}
else
{
version = gitHubReleases!.First(r => r.Prerelease == false).TagName;
}
var coreInfo = LazyConfig.Instance.GetCoreInfo(type);
string curVersion; string curVersion;
string message; string message;
string url; string url;
if (type == ECoreType.v2fly) switch (type)
{ {
curVersion = "v" + getCoreVersion(type); case ECoreType.v2fly:
message = string.Format(ResUI.IsLatestCore, curVersion); case ECoreType.SagerNet:
string osBit = Environment.Is64BitProcess ? "64" : "32"; case ECoreType.Xray:
url = string.Format(v2flyCoreUrl, version, osBit); case ECoreType.v2fly_v5:
} {
else if (type == ECoreType.Xray) curVersion = "v" + getCoreVersion(type);
{ message = string.Format(ResUI.IsLatestCore, curVersion);
curVersion = "v" + getCoreVersion(type); string osBit = Environment.Is64BitProcess ? "64" : "32";
message = string.Format(ResUI.IsLatestCore, curVersion); url = string.Format(coreInfo.coreDownloadUrl64, version, osBit);
string osBit = Environment.Is64BitProcess ? "64" : "32"; break;
url = string.Format(xrayCoreUrl, version, osBit); }
} case ECoreType.clash:
else if (type == ECoreType.v2rayN) case ECoreType.clash_meta:
{ {
curVersion = FileVersionInfo.GetVersionInfo(Utils.GetExePath()).FileVersion.ToString(); curVersion = getCoreVersion(type);
message = string.Format(ResUI.IsLatestN, curVersion); message = string.Format(ResUI.IsLatestCore, curVersion);
url = string.Format(nUrl, version); if (Environment.Is64BitProcess)
} {
else url = string.Format(coreInfo.coreDownloadUrl64, version);
{ }
throw new ArgumentException("Type"); else
{
url = string.Format(coreInfo.coreDownloadUrl32, version);
}
break;
}
case ECoreType.v2rayN:
{
curVersion = FileVersionInfo.GetVersionInfo(Utils.GetExePath()).FileVersion.ToString();
message = string.Format(ResUI.IsLatestN, curVersion);
url = string.Format(coreInfo.coreDownloadUrl64, version);
break;
}
default:
throw new ArgumentException("Type");
} }
if (curVersion == version) if (string.Compare(curVersion, version, true) >= 0)
{ {
AbsoluteCompleted?.Invoke(this, new ResultEventArgs(false, message)); AbsoluteCompleted?.Invoke(this, new ResultEventArgs(false, message));
return; return;

View File

@@ -27,8 +27,9 @@ namespace v2rayN.Handler
/// <param name="fileName"></param> /// <param name="fileName"></param>
/// <param name="msg"></param> /// <param name="msg"></param>
/// <returns></returns> /// <returns></returns>
public static int GenerateClientConfig(VmessItem node, string fileName, bool blExport, out string msg) public static int GenerateClientConfig(VmessItem node, string fileName, out string msg, out string content)
{ {
content = string.Empty;
try try
{ {
if (node == null) if (node == null)
@@ -42,55 +43,34 @@ namespace v2rayN.Handler
{ {
return GenerateClientCustomConfig(node, fileName, out msg); return GenerateClientCustomConfig(node, fileName, out msg);
} }
else
//取得默认配置
string result = Utils.GetEmbedText(SampleClient);
if (Utils.IsNullOrEmpty(result))
{ {
msg = ResUI.FailedGetDefaultConfiguration; V2rayConfig v2rayConfig = null;
return -1; if (GenerateClientConfigContent(node, false, ref v2rayConfig, out msg) != 0)
{
return -1;
}
if (Utils.IsNullOrEmpty(fileName))
{
content = Utils.ToJson(v2rayConfig);
}
else
{
Utils.ToJsonFile(v2rayConfig, fileName, false);
}
} }
//转成Json
V2rayConfig v2rayConfig = Utils.FromJson<V2rayConfig>(result);
if (v2rayConfig == null)
{
msg = ResUI.FailedGenDefaultConfiguration;
return -1;
}
var config = LazyConfig.Instance.GetConfig();
//开始修改配置
log(config, ref v2rayConfig, blExport);
//本地端口
inbound(config, ref v2rayConfig);
//路由
routing(config, ref v2rayConfig);
//outbound
outbound(node, ref v2rayConfig);
//dns
dns(config, ref v2rayConfig);
// TODO: 统计配置
statistic(config, ref v2rayConfig);
Utils.ToJsonFile(v2rayConfig, fileName, false);
msg = string.Format(ResUI.SuccessfulConfiguration, $"[{config.GetGroupRemarks(node.groupId)}] {node.GetSummary()}");
} }
catch catch (Exception ex)
{ {
Utils.SaveLog("GenerateClientConfig", ex);
msg = ResUI.FailedGenDefaultConfiguration; msg = ResUI.FailedGenDefaultConfiguration;
return -1; return -1;
} }
return 0; return 0;
} }
/// <summary> /// <summary>
/// 日志 /// 日志
/// </summary> /// </summary>
@@ -130,8 +110,9 @@ namespace v2rayN.Handler
} }
} }
} }
catch catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex);
} }
return 0; return 0;
} }
@@ -146,55 +127,65 @@ namespace v2rayN.Handler
{ {
try try
{ {
Inbounds inbound = v2rayConfig.inbounds[0]; v2rayConfig.inbounds = new List<Inbounds>();
inbound.tag = Global.InboundSocks;
inbound.port = config.inbound[0].localPort; Inbounds inbound = GetInbound(config.inbound[0], Global.InboundSocks, 0, true);
inbound.protocol = config.inbound[0].protocol; v2rayConfig.inbounds.Add(inbound);
if (config.inbound[0].allowLANConn)
{
inbound.listen = "0.0.0.0";
}
else
{
inbound.listen = Global.Loopback;
}
//udp
inbound.settings.udp = config.inbound[0].udpEnabled;
inbound.sniffing.enabled = config.inbound[0].sniffingEnabled;
//http //http
Inbounds inbound2 = v2rayConfig.inbounds[1]; Inbounds inbound2 = GetInbound(config.inbound[0], Global.InboundHttp, 1, false);
inbound2.tag = Global.InboundHttp; v2rayConfig.inbounds.Add(inbound2);
inbound2.port = config.GetLocalPort(Global.InboundHttp);
inbound2.protocol = Global.InboundHttp;
inbound2.listen = inbound.listen;
inbound2.settings.allowTransparent = false;
inbound2.sniffing.enabled = inbound.sniffing.enabled;
//auth if (config.inbound[0].allowLANConn)
if (!Utils.IsNullOrEmpty(config.inbound[0].user) && !Utils.IsNullOrEmpty(config.inbound[0].pass))
{ {
inbound.settings.auth = "password"; Inbounds inbound3 = GetInbound(config.inbound[0], Global.InboundSocks2, 2, true);
inbound.settings.accounts = new List<AccountsItem> { new AccountsItem() { user = config.inbound[0].user, pass = config.inbound[0].pass } }; inbound3.listen = "0.0.0.0";
inbound2.settings.auth = "password"; v2rayConfig.inbounds.Add(inbound3);
inbound2.settings.accounts = new List<AccountsItem> { new AccountsItem() { user = config.inbound[0].user, pass = config.inbound[0].pass } };
}
//http Loopback Inbounds inbound4 = GetInbound(config.inbound[0], Global.InboundHttp2, 3, false);
Inbounds inbound3 = v2rayConfig.inbounds[2]; inbound4.listen = "0.0.0.0";
inbound3.tag = Global.InboundHttp2; v2rayConfig.inbounds.Add(inbound4);
inbound3.port = config.GetLocalPort(Global.InboundHttp2);
inbound3.protocol = Global.InboundHttp; //auth
inbound3.listen = Global.Loopback; if (!Utils.IsNullOrEmpty(config.inbound[0].user) && !Utils.IsNullOrEmpty(config.inbound[0].pass))
inbound3.settings.allowTransparent = false; {
inbound3.sniffing.enabled = inbound.sniffing.enabled; inbound3.settings.auth = "password";
inbound3.settings.accounts = new List<AccountsItem> { new AccountsItem() { user = config.inbound[0].user, pass = config.inbound[0].pass } };
inbound4.settings.auth = "password";
inbound4.settings.accounts = new List<AccountsItem> { new AccountsItem() { user = config.inbound[0].user, pass = config.inbound[0].pass } };
}
}
} }
catch catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex);
} }
return 0; return 0;
} }
private static Inbounds GetInbound(InItem inItem, string tag, int offset, bool bSocks)
{
string result = Utils.GetEmbedText(Global.v2raySampleInbound);
if (Utils.IsNullOrEmpty(result))
{
return null;
}
var inbound = Utils.FromJson<Inbounds>(result);
if (inbound == null)
{
return null;
}
inbound.tag = tag;
inbound.port = inItem.localPort + offset;
inbound.protocol = bSocks ? Global.InboundSocks : Global.InboundHttp;
inbound.settings.udp = inItem.udpEnabled;
inbound.sniffing.enabled = inItem.sniffingEnabled;
return inbound;
}
/// <summary> /// <summary>
/// 路由 /// 路由
/// </summary> /// </summary>
@@ -209,7 +200,7 @@ namespace v2rayN.Handler
&& v2rayConfig.routing.rules != null) && v2rayConfig.routing.rules != null)
{ {
v2rayConfig.routing.domainStrategy = config.domainStrategy; v2rayConfig.routing.domainStrategy = config.domainStrategy;
v2rayConfig.routing.domainMatcher = config.domainMatcher; v2rayConfig.routing.domainMatcher = Utils.IsNullOrEmpty(config.domainMatcher) ? null : config.domainMatcher;
if (config.enableRoutingAdvanced) if (config.enableRoutingAdvanced)
{ {
@@ -237,8 +228,9 @@ namespace v2rayN.Handler
} }
} }
} }
catch catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex);
} }
return 0; return 0;
} }
@@ -336,8 +328,9 @@ namespace v2rayN.Handler
} }
} }
} }
catch catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex);
} }
return 0; return 0;
} }
@@ -354,7 +347,7 @@ namespace v2rayN.Handler
{ {
var config = LazyConfig.Instance.GetConfig(); var config = LazyConfig.Instance.GetConfig();
Outbounds outbound = v2rayConfig.outbounds[0]; Outbounds outbound = v2rayConfig.outbounds[0];
if (node.configType == EConfigType.Vmess) if (node.configType == EConfigType.VMess)
{ {
VnextItem vnextItem; VnextItem vnextItem;
if (outbound.settings.vnext.Count <= 0) if (outbound.settings.vnext.Count <= 0)
@@ -397,9 +390,7 @@ namespace v2rayN.Handler
outbound.mux.enabled = config.muxEnabled; outbound.mux.enabled = config.muxEnabled;
outbound.mux.concurrency = config.muxEnabled ? 8 : -1; outbound.mux.concurrency = config.muxEnabled ? 8 : -1;
//远程服务器底层传输配置 boundStreamSettings(node, "out", outbound.streamSettings);
StreamSettings streamSettings = outbound.streamSettings;
boundStreamSettings(node, "out", ref streamSettings);
outbound.protocol = Global.vmessProtocolLite; outbound.protocol = Global.vmessProtocolLite;
outbound.settings.servers = null; outbound.settings.servers = null;
@@ -420,14 +411,7 @@ namespace v2rayN.Handler
serversItem.address = node.address; serversItem.address = node.address;
serversItem.port = node.port; serversItem.port = node.port;
serversItem.password = node.id; serversItem.password = node.id;
if (LazyConfig.Instance.GetShadowsocksSecuritys().Contains(node.security)) serversItem.method = LazyConfig.Instance.GetShadowsocksSecuritys(node).Contains(node.security) ? node.security : "none";
{
serversItem.method = node.security;
}
else
{
serversItem.method = "none";
}
serversItem.ota = false; serversItem.ota = false;
@@ -436,6 +420,7 @@ namespace v2rayN.Handler
outbound.mux.enabled = false; outbound.mux.enabled = false;
outbound.mux.concurrency = -1; outbound.mux.concurrency = -1;
boundStreamSettings(node, "out", outbound.streamSettings);
outbound.protocol = Global.ssProtocolLite; outbound.protocol = Global.ssProtocolLite;
outbound.settings.vnext = null; outbound.settings.vnext = null;
@@ -513,9 +498,7 @@ namespace v2rayN.Handler
outbound.mux.enabled = config.muxEnabled; outbound.mux.enabled = config.muxEnabled;
outbound.mux.concurrency = config.muxEnabled ? 8 : -1; outbound.mux.concurrency = config.muxEnabled ? 8 : -1;
//远程服务器底层传输配置 boundStreamSettings(node, "out", outbound.streamSettings);
StreamSettings streamSettings = outbound.streamSettings;
boundStreamSettings(node, "out", ref streamSettings);
//if xtls //if xtls
if (node.streamSecurity == Global.StreamSecurityX) if (node.streamSecurity == Global.StreamSecurityX)
@@ -576,34 +559,32 @@ namespace v2rayN.Handler
outbound.mux.enabled = false; outbound.mux.enabled = false;
outbound.mux.concurrency = -1; outbound.mux.concurrency = -1;
boundStreamSettings(node, "out", outbound.streamSettings);
//远程服务器底层传输配置
StreamSettings streamSettings = outbound.streamSettings;
boundStreamSettings(node, "out", ref streamSettings);
outbound.protocol = Global.trojanProtocolLite; outbound.protocol = Global.trojanProtocolLite;
outbound.settings.vnext = null; outbound.settings.vnext = null;
} }
} }
catch catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex);
} }
return 0; return 0;
} }
/// <summary> /// <summary>
/// vmess协议远程服务器底层传输配置 /// 底层传输配置
/// </summary> /// </summary>
/// <param name="node"></param> /// <param name="node"></param>
/// <param name="iobound"></param> /// <param name="iobound"></param>
/// <param name="streamSettings"></param> /// <param name="streamSettings"></param>
/// <returns></returns> /// <returns></returns>
private static int boundStreamSettings(VmessItem node, string iobound, ref StreamSettings streamSettings) private static int boundStreamSettings(VmessItem node, string iobound, StreamSettings streamSettings)
{ {
try try
{ {
var config = LazyConfig.Instance.GetConfig(); var config = LazyConfig.Instance.GetConfig();
//远程服务器底层传输配置
streamSettings.network = node.GetNetwork(); streamSettings.network = node.GetNetwork();
string host = node.requestHost.TrimEx(); string host = node.requestHost.TrimEx();
string sni = node.sni; string sni = node.sni;
@@ -616,7 +597,8 @@ namespace v2rayN.Handler
TlsSettings tlsSettings = new TlsSettings TlsSettings tlsSettings = new TlsSettings
{ {
allowInsecure = Utils.ToBool(node.allowInsecure), allowInsecure = Utils.ToBool(node.allowInsecure),
alpn = node.GetAlpn() alpn = node.GetAlpn(),
fingerprint = node.fingerprint
}; };
if (!string.IsNullOrWhiteSpace(sni)) if (!string.IsNullOrWhiteSpace(sni))
{ {
@@ -637,7 +619,8 @@ namespace v2rayN.Handler
TlsSettings xtlsSettings = new TlsSettings TlsSettings xtlsSettings = new TlsSettings
{ {
allowInsecure = Utils.ToBool(node.allowInsecure), allowInsecure = Utils.ToBool(node.allowInsecure),
alpn = node.GetAlpn() alpn = node.GetAlpn(),
fingerprint = node.fingerprint
}; };
if (!string.IsNullOrWhiteSpace(sni)) if (!string.IsNullOrWhiteSpace(sni))
{ {
@@ -758,10 +741,12 @@ namespace v2rayN.Handler
} }
break; break;
case "grpc": case "grpc":
var grpcSettings = new GrpcSettings(); var grpcSettings = new GrpcSettings
{
serviceName = node.path,
multiMode = (node.headerType == Global.GrpcmultiMode)
};
grpcSettings.serviceName = node.path;
grpcSettings.multiMode = (node.headerType == Global.GrpcmultiMode ? true : false);
streamSettings.grpcSettings = grpcSettings; streamSettings.grpcSettings = grpcSettings;
break; break;
default: default:
@@ -782,7 +767,7 @@ namespace v2rayN.Handler
string request = Utils.GetEmbedText(Global.v2raySampleHttprequestFileName); string request = Utils.GetEmbedText(Global.v2raySampleHttprequestFileName);
string[] arrHost = host.Split(','); string[] arrHost = host.Split(',');
string host2 = string.Join("\",\"", arrHost); string host2 = string.Join("\",\"", arrHost);
request = request.Replace("$requestHost$", string.Format("\"{0}\"", host2)); request = request.Replace("$requestHost$", $"\"{host2}\"");
//request = request.Replace("$requestHost$", string.Format("\"{0}\"", config.requestHost())); //request = request.Replace("$requestHost$", string.Format("\"{0}\"", config.requestHost()));
//填入自定义Path //填入自定义Path
@@ -792,7 +777,7 @@ namespace v2rayN.Handler
string[] arrPath = node.path.Split(','); string[] arrPath = node.path.Split(',');
pathHttp = string.Join("\",\"", arrPath); pathHttp = string.Join("\",\"", arrPath);
} }
request = request.Replace("$requestPath$", string.Format("\"{0}\"", pathHttp)); request = request.Replace("$requestPath$", $"\"{pathHttp}\"");
tcpSettings.header.request = Utils.FromJson<object>(request); tcpSettings.header.request = Utils.FromJson<object>(request);
} }
else if (iobound.Equals("in")) else if (iobound.Equals("in"))
@@ -806,8 +791,9 @@ namespace v2rayN.Handler
break; break;
} }
} }
catch catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex);
} }
return 0; return 0;
} }
@@ -827,6 +813,14 @@ namespace v2rayN.Handler
return 0; return 0;
} }
//Outbound Freedom domainStrategy
if (!string.IsNullOrWhiteSpace(config.domainStrategy4Freedom))
{
var outbound = v2rayConfig.outbounds[1];
outbound.settings.domainStrategy = config.domainStrategy4Freedom;
outbound.settings.userLevel = 0;
}
var obj = Utils.ParseJson(config.remoteDNS); var obj = Utils.ParseJson(config.remoteDNS);
if (obj != null && obj.ContainsKey("servers")) if (obj != null && obj.ContainsKey("servers"))
{ {
@@ -851,8 +845,9 @@ namespace v2rayN.Handler
}; };
} }
} }
catch catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex);
} }
return 0; return 0;
} }
@@ -879,7 +874,7 @@ namespace v2rayN.Handler
policyObj.system = policySystemSetting; policyObj.system = policySystemSetting;
v2rayConfig.policy = policyObj; v2rayConfig.policy = policyObj;
if (!v2rayConfig.inbounds.Exists(item => { return item.tag == tag; })) if (!v2rayConfig.inbounds.Exists(item => item.tag == tag))
{ {
Inbounds apiInbound = new Inbounds(); Inbounds apiInbound = new Inbounds();
Inboundsettings apiInboundSettings = new Inboundsettings(); Inboundsettings apiInboundSettings = new Inboundsettings();
@@ -892,7 +887,7 @@ namespace v2rayN.Handler
v2rayConfig.inbounds.Add(apiInbound); v2rayConfig.inbounds.Add(apiInbound);
} }
if (!v2rayConfig.routing.rules.Exists(item => { return item.outboundTag == tag; })) if (!v2rayConfig.routing.rules.Exists(item => item.outboundTag == tag))
{ {
RulesItem apiRoutingRule = new RulesItem RulesItem apiRoutingRule = new RulesItem
{ {
@@ -932,7 +927,7 @@ namespace v2rayN.Handler
string addressFileName = node.address; string addressFileName = node.address;
if (!File.Exists(addressFileName)) if (!File.Exists(addressFileName))
{ {
addressFileName = Path.Combine(Utils.GetConfigPath(), addressFileName); addressFileName = Utils.GetConfigPath(addressFileName);
} }
if (!File.Exists(addressFileName)) if (!File.Exists(addressFileName))
{ {
@@ -949,21 +944,40 @@ namespace v2rayN.Handler
} }
//overwrite port //overwrite port
var fileContent = File.ReadAllLines(fileName).ToList(); if (node.preSocksPort <= 0)
var coreType = LazyConfig.Instance.GetCoreType(node, node.configType);
switch (coreType)
{ {
case ECoreType.v2fly: var fileContent = File.ReadAllLines(fileName).ToList();
case ECoreType.Xray: var coreType = LazyConfig.Instance.GetCoreType(node, node.configType);
break; switch (coreType)
case ECoreType.clash: {
fileContent.Add($"port: {LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundHttp)}"); case ECoreType.v2fly:
fileContent.Add($"socks-port: {LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundSocks)}"); case ECoreType.SagerNet:
break; case ECoreType.Xray:
} case ECoreType.v2fly_v5:
File.WriteAllLines(fileName, fileContent); break;
case ECoreType.clash:
case ECoreType.clash_meta:
//remove the original
var indexPort = fileContent.FindIndex(t => t.Contains("port:"));
if (indexPort >= 0)
{
fileContent.RemoveAt(indexPort);
}
indexPort = fileContent.FindIndex(t => t.Contains("socks-port:"));
if (indexPort >= 0)
{
fileContent.RemoveAt(indexPort);
}
msg = string.Format(ResUI.SuccessfulConfiguration, $"[{LazyConfig.Instance.GetConfig().GetGroupRemarks(node.groupId)}] {node.GetSummary()}"); fileContent.Add($"port: {LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundHttp)}");
fileContent.Add($"socks-port: {LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundSocks)}");
break;
}
File.WriteAllLines(fileName, fileContent);
}
//msg = string.Format(ResUI.SuccessfulConfiguration, $"[{LazyConfig.Instance.GetConfig().GetGroupRemarks(node.groupId)}] {node.GetSummary()}");
msg = string.Format(ResUI.SuccessfulConfiguration, "");
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -974,6 +988,66 @@ namespace v2rayN.Handler
return 0; return 0;
} }
public static int GenerateClientConfigContent(VmessItem node, bool blExport, ref V2rayConfig v2rayConfig, out string msg)
{
try
{
if (node == null)
{
msg = ResUI.CheckServerSettings;
return -1;
}
msg = ResUI.InitialConfiguration;
//取得默认配置
string result = Utils.GetEmbedText(SampleClient);
if (Utils.IsNullOrEmpty(result))
{
msg = ResUI.FailedGetDefaultConfiguration;
return -1;
}
//转成Json
v2rayConfig = Utils.FromJson<V2rayConfig>(result);
if (v2rayConfig == null)
{
msg = ResUI.FailedGenDefaultConfiguration;
return -1;
}
var config = LazyConfig.Instance.GetConfig();
//开始修改配置
log(config, ref v2rayConfig, blExport);
//本地端口
inbound(config, ref v2rayConfig);
//路由
routing(config, ref v2rayConfig);
//outbound
outbound(node, ref v2rayConfig);
//dns
dns(config, ref v2rayConfig);
//stat
statistic(config, ref v2rayConfig);
//msg = string.Format(ResUI.SuccessfulConfiguration, $"[{config.GetGroupRemarks(node.groupId)}] {node.GetSummary()}");
msg = string.Format(ResUI.SuccessfulConfiguration, "");
}
catch (Exception ex)
{
Utils.SaveLog("GenerateClientConfig", ex);
msg = ResUI.FailedGenDefaultConfiguration;
return -1;
}
return 0;
}
#endregion #endregion
#region #region
@@ -1029,8 +1103,9 @@ namespace v2rayN.Handler
msg = string.Format(ResUI.SuccessfulConfiguration, node.GetSummary()); msg = string.Format(ResUI.SuccessfulConfiguration, node.GetSummary());
} }
catch catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex);
msg = ResUI.FailedGenDefaultConfiguration; msg = ResUI.FailedGenDefaultConfiguration;
return -1; return -1;
} }
@@ -1065,7 +1140,7 @@ namespace v2rayN.Handler
usersItem.id = node.id; usersItem.id = node.id;
usersItem.email = Global.userEMail; usersItem.email = Global.userEMail;
if (node.configType == EConfigType.Vmess) if (node.configType == EConfigType.VMess)
{ {
inbound.protocol = Global.vmessProtocolLite; inbound.protocol = Global.vmessProtocolLite;
usersItem.alterId = node.alterId; usersItem.alterId = node.alterId;
@@ -1078,12 +1153,11 @@ namespace v2rayN.Handler
inbound.settings.decryption = node.security; inbound.settings.decryption = node.security;
} }
//远程服务器底层传输配置 boundStreamSettings(node, "in", inbound.streamSettings);
StreamSettings streamSettings = inbound.streamSettings;
boundStreamSettings(node, "in", ref streamSettings);
} }
catch catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex);
} }
return 0; return 0;
} }
@@ -1103,8 +1177,9 @@ namespace v2rayN.Handler
v2rayConfig.outbounds[0].settings = null; v2rayConfig.outbounds[0].settings = null;
} }
} }
catch catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex);
} }
return 0; return 0;
} }
@@ -1169,7 +1244,7 @@ namespace v2rayN.Handler
vmessItem.port = outbound.settings.vnext[0].port; vmessItem.port = outbound.settings.vnext[0].port;
vmessItem.id = outbound.settings.vnext[0].users[0].id; vmessItem.id = outbound.settings.vnext[0].users[0].id;
vmessItem.alterId = outbound.settings.vnext[0].users[0].alterId; vmessItem.alterId = outbound.settings.vnext[0].users[0].alterId;
vmessItem.remarks = string.Format("import@{0}", DateTime.Now.ToShortDateString()); vmessItem.remarks = $"import@{DateTime.Now.ToShortDateString()}";
//tcp or kcp //tcp or kcp
if (outbound.streamSettings != null if (outbound.streamSettings != null
@@ -1249,8 +1324,9 @@ namespace v2rayN.Handler
vmessItem.streamSecurity = Global.StreamSecurity; vmessItem.streamSecurity = Global.StreamSecurity;
} }
} }
catch catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex);
msg = ResUI.IncorrectClientConfiguration; msg = ResUI.IncorrectClientConfiguration;
return null; return null;
} }
@@ -1314,7 +1390,7 @@ namespace v2rayN.Handler
vmessItem.id = inbound.settings.clients[0].id; vmessItem.id = inbound.settings.clients[0].id;
vmessItem.alterId = inbound.settings.clients[0].alterId; vmessItem.alterId = inbound.settings.clients[0].alterId;
vmessItem.remarks = string.Format("import@{0}", DateTime.Now.ToShortDateString()); vmessItem.remarks = $"import@{DateTime.Now.ToShortDateString()}";
//tcp or kcp //tcp or kcp
if (inbound.streamSettings != null if (inbound.streamSettings != null
@@ -1394,8 +1470,9 @@ namespace v2rayN.Handler
vmessItem.streamSecurity = Global.StreamSecurity; vmessItem.streamSecurity = Global.StreamSecurity;
} }
} }
catch catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex);
msg = ResUI.IncorrectClientConfiguration; msg = ResUI.IncorrectClientConfiguration;
return null; return null;
} }
@@ -1411,7 +1488,12 @@ namespace v2rayN.Handler
/// <returns></returns> /// <returns></returns>
public static int Export2ClientConfig(VmessItem node, string fileName, out string msg) public static int Export2ClientConfig(VmessItem node, string fileName, out string msg)
{ {
return GenerateClientConfig(node, fileName, true, out msg); V2rayConfig v2rayConfig = null;
if (GenerateClientConfigContent(node, true, ref v2rayConfig, out msg) != 0)
{
return -1;
}
return Utils.ToJsonFile(v2rayConfig, fileName, false);
} }
/// <summary> /// <summary>
@@ -1458,12 +1540,18 @@ namespace v2rayN.Handler
msg = ResUI.FailedGenDefaultConfiguration; msg = ResUI.FailedGenDefaultConfiguration;
return ""; return "";
} }
List<IPEndPoint> lstIpEndPoints = null; List<IPEndPoint> lstIpEndPoints = new List<IPEndPoint>();
List<TcpConnectionInformation> lstTcpConns = new List<TcpConnectionInformation>();
try try
{ {
lstIpEndPoints = new List<IPEndPoint>(IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpListeners()); lstIpEndPoints.AddRange(IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpListeners());
lstIpEndPoints.AddRange(IPGlobalProperties.GetIPGlobalProperties().GetActiveUdpListeners());
lstTcpConns.AddRange(IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpConnections());
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
} }
catch { }
log(configCopy, ref v2rayConfig, false); log(configCopy, ref v2rayConfig, false);
//routing(config, ref v2rayConfig); //routing(config, ref v2rayConfig);
@@ -1483,7 +1571,7 @@ namespace v2rayN.Handler
{ {
continue; continue;
} }
if (it.configType == EConfigType.Vmess || it.configType == EConfigType.VLESS) if (it.configType == EConfigType.VMess || it.configType == EConfigType.VLESS)
{ {
if (!Utils.IsGuidByParse(configCopy.GetVmessItem(it.indexId).id)) if (!Utils.IsGuidByParse(configCopy.GetVmessItem(it.indexId).id))
{ {
@@ -1499,6 +1587,10 @@ namespace v2rayN.Handler
{ {
continue; continue;
} }
if (lstTcpConns != null && lstTcpConns.FindIndex(_it => _it.LocalEndPoint.Port == k) >= 0)
{
continue;
}
//found //found
port = k; port = k;
httpPort = port + 1; httpPort = port + 1;
@@ -1539,8 +1631,9 @@ namespace v2rayN.Handler
//msg = string.Format(ResUI.SuccessfulConfiguration"), node.getSummary()); //msg = string.Format(ResUI.SuccessfulConfiguration"), node.getSummary());
return Utils.ToJson(v2rayConfig); return Utils.ToJson(v2rayConfig);
} }
catch catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex);
msg = ResUI.FailedGenDefaultConfiguration; msg = ResUI.FailedGenDefaultConfiguration;
return ""; return "";
} }

View File

@@ -24,7 +24,7 @@ namespace v2rayN.Handler
private static string v2rayConfigRes = Global.v2rayConfigFileName; private static string v2rayConfigRes = Global.v2rayConfigFileName;
private CoreInfo coreInfo; private CoreInfo coreInfo;
public event ProcessDelegate ProcessEvent; public event ProcessDelegate ProcessEvent;
//private int processId = 0; private int processId = 0;
private Process _process; private Process _process;
public V2rayHandler() public V2rayHandler()
@@ -51,15 +51,31 @@ namespace v2rayN.Handler
return; return;
} }
string fileName = Utils.GetPath(v2rayConfigRes); string fileName = Utils.GetPath(v2rayConfigRes);
if (V2rayConfigHandler.GenerateClientConfig(item, fileName, false, out string msg) != 0) if (V2rayConfigHandler.GenerateClientConfig(item, fileName, out string msg, out string content) != 0)
{ {
ShowMsg(false, msg); ShowMsg(false, msg);
} }
else else
{ {
ShowMsg(true, msg); ShowMsg(false, msg);
ShowMsg(true, $"[{config.GetGroupRemarks(item.groupId)}] {item.GetSummary()}");
V2rayRestart(); V2rayRestart();
} }
//start a socks service
if (item.configType == EConfigType.Custom && item.preSocksPort > 0)
{
var itemSocks = new VmessItem()
{
configType = EConfigType.Socks,
address = Global.Loopback,
port = item.preSocksPort
};
if (V2rayConfigHandler.GenerateClientConfig(itemSocks, null, out string msg2, out string configStr) == 0)
{
processId = V2rayStartNew(configStr);
}
}
} }
} }
@@ -127,27 +143,12 @@ namespace v2rayN.Handler
} }
} }
//bool blExist = true; if (processId > 0)
//if (processId > 0) {
//{ V2rayStopPid(processId);
// Process p1 = Process.GetProcessById(processId); processId = 0;
// if (p1 != null) }
// {
// p1.Kill();
// blExist = false;
// }
//}
//if (blExist)
//{
// foreach (string vName in lstV2ray)
// {
// Process[] killPro = Process.GetProcessesByName(vName);
// foreach (Process p in killPro)
// {
// p.Kill();
// }
// }
//}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -175,7 +176,7 @@ namespace v2rayN.Handler
string fileName = string.Empty; string fileName = string.Empty;
foreach (string name in lstCoreTemp) foreach (string name in lstCoreTemp)
{ {
string vName = string.Format("{0}.exe", name); string vName = $"{name}.exe";
vName = Utils.GetPath(vName); vName = Utils.GetPath(vName);
if (File.Exists(vName)) if (File.Exists(vName))
{ {
@@ -185,7 +186,7 @@ namespace v2rayN.Handler
} }
if (Utils.IsNullOrEmpty(fileName)) if (Utils.IsNullOrEmpty(fileName))
{ {
string msg = string.Format(ResUI.NotFoundCore, coreInfo.coreUrl); string msg = string.Format(ResUI.NotFoundCore, string.Join(", ", lstCoreTemp.ToArray()), coreInfo.coreUrl);
ShowMsg(false, msg); ShowMsg(false, msg);
} }
return fileName; return fileName;
@@ -211,24 +212,29 @@ namespace v2rayN.Handler
Arguments = coreInfo.arguments, Arguments = coreInfo.arguments,
WorkingDirectory = Utils.StartupPath(), WorkingDirectory = Utils.StartupPath(),
UseShellExecute = false, UseShellExecute = false,
RedirectStandardOutput = true, RedirectStandardOutput = coreInfo.redirectInfo,
RedirectStandardError = true, RedirectStandardError = coreInfo.redirectInfo,
CreateNoWindow = true, CreateNoWindow = true,
StandardOutputEncoding = Encoding.UTF8 StandardOutputEncoding = coreInfo.redirectInfo ? Encoding.UTF8 : null,
StandardErrorEncoding = coreInfo.redirectInfo ? Encoding.UTF8 : null,
} }
}; };
p.OutputDataReceived += new DataReceivedEventHandler((sender, e) => if (coreInfo.redirectInfo)
{ {
if (!String.IsNullOrEmpty(e.Data)) p.OutputDataReceived += (sender, e) =>
{ {
string msg = e.Data + Environment.NewLine; if (!String.IsNullOrEmpty(e.Data))
ShowMsg(false, msg); {
} string msg = e.Data + Environment.NewLine;
}); ShowMsg(false, msg);
}
};
}
p.Start(); p.Start();
p.PriorityClass = ProcessPriorityClass.High; if (coreInfo.redirectInfo)
p.BeginOutputReadLine(); {
//processId = p.Id; p.BeginOutputReadLine();
}
_process = p; _process = p;
if (p.WaitForExit(1000)) if (p.WaitForExit(1000))
@@ -254,7 +260,7 @@ namespace v2rayN.Handler
try try
{ {
string fileName = V2rayFindexe(new List<string> { "xray" }); string fileName = V2rayFindexe(new List<string> { "xray", "wv2ray", "v2ray" });
if (fileName == "") return -1; if (fileName == "") return -1;
Process p = new Process Process p = new Process
@@ -269,17 +275,18 @@ namespace v2rayN.Handler
RedirectStandardOutput = true, RedirectStandardOutput = true,
RedirectStandardError = true, RedirectStandardError = true,
CreateNoWindow = true, CreateNoWindow = true,
StandardOutputEncoding = Encoding.UTF8 StandardOutputEncoding = Encoding.UTF8,
StandardErrorEncoding = Encoding.UTF8
} }
}; };
p.OutputDataReceived += new DataReceivedEventHandler((sender, e) => p.OutputDataReceived += (sender, e) =>
{ {
if (!String.IsNullOrEmpty(e.Data)) if (!String.IsNullOrEmpty(e.Data))
{ {
string msg = e.Data + Environment.NewLine; string msg = e.Data + Environment.NewLine;
ShowMsg(false, msg); ShowMsg(false, msg);
} }
}); };
p.Start(); p.Start();
p.BeginOutputReadLine(); p.BeginOutputReadLine();

View File

@@ -84,6 +84,14 @@ namespace v2rayN.Mode
get; set; get; set;
} }
/// <summary>
/// Outbound Freedom domainStrategy
/// </summary>
public string domainStrategy4Freedom
{
get; set;
}
/// <summary> /// <summary>
/// 是否允许不安全连接 /// 是否允许不安全连接
/// </summary> /// </summary>
@@ -124,17 +132,21 @@ namespace v2rayN.Mode
{ {
get; set; get; set;
} }
public string systemProxyAdvancedProtocol { get; set; }
public int autoUpdateInterval public int autoUpdateInterval { get; set; } = 0;
{
get; set; public int autoUpdateSubInterval { get; set; } = 0;
} = 0;
public bool checkPreReleaseUpdate { get; set; } = false;
public bool enableSecurityProtocolTls13 public bool enableSecurityProtocolTls13
{ {
get; set; get; set;
} }
public int trayMenuServersLimit { get; set; }
#endregion #endregion
#region other entities #region other entities
@@ -208,27 +220,27 @@ namespace v2rayN.Mode
public int GetLocalPort(string protocol) public int GetLocalPort(string protocol)
{ {
if (protocol == Global.InboundHttp) int localPort = inbound.FirstOrDefault(t => t.protocol == Global.InboundSocks).localPort;
if (protocol == Global.InboundSocks)
{ {
return GetLocalPort(Global.InboundSocks) + 1; return localPort;
}
else if (protocol == Global.InboundHttp)
{
return localPort + 1;
}
else if (protocol == Global.InboundSocks2)
{
return localPort + 2;
} }
else if (protocol == Global.InboundHttp2) else if (protocol == Global.InboundHttp2)
{ {
return GetLocalPort(Global.InboundSocks) + 2; return localPort + 3;
} }
else if (protocol == "speedtest") else if (protocol == "speedtest")
{ {
return GetLocalPort(Global.InboundSocks) + 103; return localPort + 103;
}
int localPort = 0;
foreach (InItem inItem in inbound)
{
if (inItem.protocol.Equals(protocol))
{
localPort = inItem.localPort;
break;
}
} }
return localPort; return localPort;
} }
@@ -280,7 +292,7 @@ namespace v2rayN.Mode
public VmessItem() public VmessItem()
{ {
indexId = string.Empty; indexId = string.Empty;
configType = EConfigType.Vmess; configType = EConfigType.VMess;
configVersion = 2; configVersion = 2;
sort = 0; sort = 0;
address = string.Empty; address = string.Empty;
@@ -321,7 +333,7 @@ namespace v2rayN.Mode
} }
switch (configType) switch (configType)
{ {
case EConfigType.Vmess: case EConfigType.VMess:
case EConfigType.Shadowsocks: case EConfigType.Shadowsocks:
case EConfigType.Socks: case EConfigType.Socks:
case EConfigType.VLESS: case EConfigType.VLESS:
@@ -341,19 +353,31 @@ namespace v2rayN.Mode
{ {
return subRemarks; return subRemarks;
} }
foreach (SubItem sub in config.subItem)
{
if (sub.id.EndsWith(subid))
{
return sub.remarks;
}
}
if (subid.Length <= 4) if (subid.Length <= 4)
{ {
return subid; return subid;
} }
var sub = config.subItem.FirstOrDefault(t => t.id == subid);
if (sub != null)
{
return sub.remarks;
}
return subid.Substring(0, 4); return subid.Substring(0, 4);
} }
public string GetGroupRemarks(Config config)
{
string subRemarks = string.Empty;
if (Utils.IsNullOrEmpty(groupId))
{
return subRemarks;
}
var group = config.groupItem.FirstOrDefault(t => t.id == groupId);
if (group != null)
{
return group.remarks;
}
return groupId.Substring(0, 4);
}
public List<string> GetAlpn() public List<string> GetAlpn()
{ {
@@ -539,10 +563,18 @@ namespace v2rayN.Mode
{ {
get; set; get; set;
} = string.Empty; } = string.Empty;
public ECoreType? coreType public ECoreType? coreType
{ {
get; set; get; set;
} }
public int preSocksPort
{
get; set;
}
public string fingerprint { get; set; }
} }
[Serializable] [Serializable]
@@ -578,9 +610,9 @@ namespace v2rayN.Mode
public bool sniffingEnabled { get; set; } = true; public bool sniffingEnabled { get; set; } = true;
public bool allowLANConn { get; set; } public bool allowLANConn { get; set; }
public string user { get; set; } public string user { get; set; }
public string pass { get; set; } public string pass { get; set; }
} }
@@ -763,6 +795,10 @@ namespace v2rayN.Mode
{ {
get; set; get; set;
} }
public int sort
{
get; set;
}
} }

View File

@@ -14,6 +14,16 @@ namespace v2rayN.Mode
public string coreUrl { get; set; } public string coreUrl { get; set; }
public string coreReleaseApiUrl { get; set; }
public string coreDownloadUrl32 { get; set; }
public string coreDownloadUrl64 { get; set; }
public string match { get; set; } public string match { get; set; }
public string versionArg { get; set; }
public bool redirectInfo { get; set; }
} }
} }

View File

@@ -3,7 +3,7 @@ namespace v2rayN.Mode
{ {
public enum EConfigType public enum EConfigType
{ {
Vmess = 1, VMess = 1,
Custom = 2, Custom = 2,
Shadowsocks = 3, Shadowsocks = 3,
Socks = 4, Socks = 4,

View File

@@ -5,8 +5,14 @@ namespace v2rayN.Mode
{ {
v2fly = 1, v2fly = 1,
Xray = 2, Xray = 2,
SagerNet = 3,
v2fly_v5 = 4,
clash = 11, clash = 11,
clash_meta = 12,
hysteria = 21, hysteria = 21,
naiveproxy = 22,
tuic = 23,
sing_box = 24,
v2rayN = 99 v2rayN = 99
} }
} }

View File

@@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace v2rayN.Mode
{
public class GitHubReleaseAsset
{
[JsonProperty("url")] public string Url { get; set; }
[JsonProperty("id")] public int Id { get; set; }
[JsonProperty("node_id")] public string NodeId { get; set; }
[JsonProperty("name")] public string Name { get; set; }
[JsonProperty("label")] public object Label { get; set; }
[JsonProperty("content_type")] public string ContentType { get; set; }
[JsonProperty("state")] public string State { get; set; }
[JsonProperty("size")] public int Size { get; set; }
[JsonProperty("download_count")] public int DownloadCount { get; set; }
[JsonProperty("created_at")] public DateTime CreatedAt { get; set; }
[JsonProperty("updated_at")] public DateTime UpdatedAt { get; set; }
[JsonProperty("browser_download_url")] public string BrowserDownloadUrl { get; set; }
}
public class GitHubRelease
{
[JsonProperty("url")] public string Url { get; set; }
[JsonProperty("assets_url")] public string AssetsUrl { get; set; }
[JsonProperty("upload_url")] public string UploadUrl { get; set; }
[JsonProperty("html_url")] public string HtmlUrl { get; set; }
[JsonProperty("id")] public int Id { get; set; }
[JsonProperty("node_id")] public string NodeId { get; set; }
[JsonProperty("tag_name")] public string TagName { get; set; }
[JsonProperty("target_commitish")] public string TargetCommitish { get; set; }
[JsonProperty("name")] public string Name { get; set; }
[JsonProperty("draft")] public bool Draft { get; set; }
[JsonProperty("prerelease")] public bool Prerelease { get; set; }
[JsonProperty("created_at")] public DateTime CreatedAt { get; set; }
[JsonProperty("published_at")] public DateTime PublishedAt { get; set; }
[JsonProperty("assets")] public List<GitHubReleaseAsset> Assets { get; set; }
[JsonProperty("tarball_url")] public string TarballUrl { get; set; }
[JsonProperty("zipball_url")] public string ZipballUrl { get; set; }
[JsonProperty("body")] public string Body { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
namespace v2rayN.Mode
{
public class SsSIP008
{
public List<SsServer> servers { get; set; }
}
[Serializable]
public class SsServer
{
public string remarks { get; set; }
public string server { get; set; }
public string server_port { get; set; }
public string method { get; set; }
public string password { get; set; }
public string plugin { get; set; }
}
}

View File

@@ -224,6 +224,16 @@ namespace v2rayN.Mode
/// ///
/// </summary> /// </summary>
public Response response { get; set; } public Response response { get; set; }
/// <summary>
///
/// </summary>
public string domainStrategy { get; set; }
/// <summary>
///
/// </summary>
public int? userLevel { get; set; }
} }
public class VnextItem public class VnextItem
@@ -412,6 +422,12 @@ namespace v2rayN.Mode
{ {
get; set; get; set;
} }
/// <summary>
/// "chrome" | "firefox" | "safari" | "randomized"
/// </summary>
public string fingerprint { get; set; }
} }
public class TcpSettings public class TcpSettings

View File

@@ -1,18 +1,13 @@
using System; using System;
using System.Diagnostics;
using System.Threading; using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
using v2rayN.Forms; using v2rayN.Forms;
using v2rayN.Properties;
using v2rayN.Tool; using v2rayN.Tool;
namespace v2rayN namespace v2rayN
{ {
static class Program static class Program
{ {
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern bool SetProcessDPIAware();
/// <summary> /// <summary>
/// 应用程序的主入口点。 /// 应用程序的主入口点。
/// </summary> /// </summary>
@@ -21,12 +16,12 @@ namespace v2rayN
{ {
if (Environment.OSVersion.Version.Major >= 6) if (Environment.OSVersion.Version.Major >= 6)
{ {
SetProcessDPIAware(); Utils.SetProcessDPIAware();
} }
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); Application.ThreadException += Application_ThreadException;
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
//AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; //AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
@@ -47,6 +42,22 @@ namespace v2rayN
} }
else else
{ {
try
{
//read handle from reg and show the window
long.TryParse(Utils.RegReadValue(Global.MyRegPath, Utils.WindowHwndKey, ""), out long llong);
if (llong > 0)
{
var hwnd = (IntPtr)llong;
if (Utils.IsWindow(hwnd))
{
Utils.ShowWindow(hwnd, 4);
Utils.SwitchToThisWindow(hwnd, true);
return;
}
}
}
catch { }
UI.ShowWarning($"v2rayN is already running(v2rayN已经运行)"); UI.ShowWarning($"v2rayN is already running(v2rayN已经运行)");
} }
} }

View File

@@ -1,35 +0,0 @@
using System.Reflection;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("v2rayN")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("v2rayN")]
[assembly: AssemblyCopyright("Copyright © 2019-2022 (GPLv3)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("72d9f089-5e7a-4c5f-be0a-8a211536b483")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
//[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("5.13")]

View File

@@ -110,6 +110,36 @@ namespace v2rayN.Properties {
} }
} }
/// <summary>
/// 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
/// </summary>
internal static System.Drawing.Icon NotifyIcon1 {
get {
object obj = ResourceManager.GetObject("NotifyIcon1", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
/// </summary>
internal static System.Drawing.Icon NotifyIcon2 {
get {
object obj = ResourceManager.GetObject("NotifyIcon2", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
/// </summary>
internal static System.Drawing.Icon NotifyIcon3 {
get {
object obj = ResourceManager.GetObject("NotifyIcon3", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary> /// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary> /// </summary>

View File

@@ -157,4 +157,13 @@
<data name="share" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="share" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\share.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\resources\share.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="NotifyIcon1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\NotifyIcon1.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="NotifyIcon2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\NotifyIcon2.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="NotifyIcon3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\NotifyIcon3.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@@ -106,7 +106,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 configuration format is incorrect 的本地化字符串。 /// 查找类似 Invalid configuration format 的本地化字符串。
/// </summary> /// </summary>
internal static string ConfigurationFormatIncorrect { internal static string ConfigurationFormatIncorrect {
get { get {
@@ -133,7 +133,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 DOWN 的本地化字符串。 /// 查找类似 Download 的本地化字符串。
/// </summary> /// </summary>
internal static string downloadSpeed { internal static string downloadSpeed {
get { get {
@@ -321,6 +321,24 @@ namespace v2rayN.Resx {
} }
} }
/// <summary>
/// 查找类似 LAN 的本地化字符串。
/// </summary>
internal static string LabLAN {
get {
return ResourceManager.GetString("LabLAN", resourceCulture);
}
}
/// <summary>
/// 查找类似 Local 的本地化字符串。
/// </summary>
internal static string LabLocal {
get {
return ResourceManager.GetString("LabLocal", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Address 的本地化字符串。 /// 查找类似 Address 的本地化字符串。
/// </summary> /// </summary>
@@ -421,7 +439,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 Today download traffic 的本地化字符串。 /// 查找类似 Download traffic today 的本地化字符串。
/// </summary> /// </summary>
internal static string LvTodayDownloadDataAmount { internal static string LvTodayDownloadDataAmount {
get { get {
@@ -430,7 +448,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 Today upload traffic 的本地化字符串。 /// 查找类似 Upload traffic today 的本地化字符串。
/// </summary> /// </summary>
internal static string LvTodayUploadDataAmount { internal static string LvTodayUploadDataAmount {
get { get {
@@ -475,7 +493,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 MediumFresh 的本地化字符串。 /// 查找类似 Medium 的本地化字符串。
/// </summary> /// </summary>
internal static string MediumFresh { internal static string MediumFresh {
get { get {
@@ -520,7 +538,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 Get the subscription content successfully 的本地化字符串。 /// 查找类似 Get subscription content successfully 的本地化字符串。
/// </summary> /// </summary>
internal static string MsgGetSubscriptionSuccessfully { internal static string MsgGetSubscriptionSuccessfully {
get { get {
@@ -529,7 +547,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 Informations (Filter : {0}) 的本地化字符串。 /// 查找类似 Information (Filter : {0}) 的本地化字符串。
/// </summary> /// </summary>
internal static string MsgInformationTitle { internal static string MsgInformationTitle {
get { get {
@@ -582,6 +600,15 @@ namespace v2rayN.Resx {
} }
} }
/// <summary>
/// 查找类似 Servers (Filter : {0}) 的本地化字符串。
/// </summary>
internal static string MsgServerTitle {
get {
return ResourceManager.GetString("MsgServerTitle", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Simplify PAC Success 的本地化字符串。 /// 查找类似 Simplify PAC Success 的本地化字符串。
/// </summary> /// </summary>
@@ -682,7 +709,16 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 Non-vmess or ss protocol 的本地化字符串。 /// 查找类似 Normal use of this version requires .NET Framework 4.8 的本地化字符串。
/// </summary>
internal static string NetFrameworkRequirementsTip {
get {
return ResourceManager.GetString("NetFrameworkRequirementsTip", resourceCulture);
}
}
/// <summary>
/// 查找类似 Non-VMess or ss protocol 的本地化字符串。
/// </summary> /// </summary>
internal static string NonvmessOrssProtocol { internal static string NonvmessOrssProtocol {
get { get {
@@ -691,7 +727,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 non-Vmess service, this feature is invalid 的本地化字符串。 /// 查找类似 non-standard service, this feature is invalid 的本地化字符串。
/// </summary> /// </summary>
internal static string NonVmessService { internal static string NonVmessService {
get { get {
@@ -700,7 +736,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 Core not found, please download: {0} 的本地化字符串。 /// 查找类似 Core not found({0}), please download: {1} 的本地化字符串。
/// </summary> /// </summary>
internal static string NotFoundCore { internal static string NotFoundCore {
get { get {
@@ -718,7 +754,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 operation failed, please check retry 的本地化字符串。 /// 查找类似 operation failed, please check and retry 的本地化字符串。
/// </summary> /// </summary>
internal static string OperationFailed { internal static string OperationFailed {
get { get {
@@ -754,7 +790,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 Please select an agreement 的本地化字符串。 /// 查找类似 Please select a protocol 的本地化字符串。
/// </summary> /// </summary>
internal static string PleaseSelectProtocol { internal static string PleaseSelectProtocol {
get { get {
@@ -781,7 +817,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 QuickFresh 的本地化字符串。 /// 查找类似 Fast 的本地化字符串。
/// </summary> /// </summary>
internal static string QuickFresh { internal static string QuickFresh {
get { get {
@@ -862,7 +898,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 SlowFresh 的本地化字符串。 /// 查找类似 Slow 的本地化字符串。
/// </summary> /// </summary>
internal static string SlowFresh { internal static string SlowFresh {
get { get {
@@ -871,7 +907,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 Note: After this function relies on the Http global proxy test, please manually adjust the Http global proxy and active node! 的本地化字符串。 /// 查找类似 Note: This feature relies on the Http global proxy. Please manually adjust the Http global proxy and active node after testing. 的本地化字符串。
/// </summary> /// </summary>
internal static string SpeedServerTips { internal static string SpeedServerTips {
get { get {
@@ -880,7 +916,16 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 PAC failed to start. Run it with Admin right. 的本地化字符串。 /// 查找类似 Speed Test... 的本地化字符串。
/// </summary>
internal static string Speedtesting {
get {
return ResourceManager.GetString("Speedtesting", resourceCulture);
}
}
/// <summary>
/// 查找类似 PAC failed to start. Please run this program as Administrator. 的本地化字符串。
/// </summary> /// </summary>
internal static string StartPacFailed { internal static string StartPacFailed {
get { get {
@@ -898,7 +943,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 Successful configuration /// 查找类似 Configuration successful
///{0} 的本地化字符串。 ///{0} 的本地化字符串。
/// </summary> /// </summary>
internal static string SuccessfulConfiguration { internal static string SuccessfulConfiguration {
@@ -908,7 +953,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 Successfully imported custom configuration server 的本地化字符串。 /// 查找类似 Custom configuration server imported successfully. 的本地化字符串。
/// </summary> /// </summary>
internal static string SuccessfullyImportedCustomServer { internal static string SuccessfullyImportedCustomServer {
get { get {
@@ -944,7 +989,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 The ping of current service: {0} 的本地化字符串。 /// 查找类似 The ping of current service: {0} ms 的本地化字符串。
/// </summary> /// </summary>
internal static string TestMeOutput { internal static string TestMeOutput {
get { get {
@@ -952,6 +997,15 @@ namespace v2rayN.Resx {
} }
} }
/// <summary>
/// 查找类似 Too many servers, please open the main interface 的本地化字符串。
/// </summary>
internal static string TooManyServersTip {
get {
return ResourceManager.GetString("TooManyServersTip", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 *tcp camouflage type 的本地化字符串。 /// 查找类似 *tcp camouflage type 的本地化字符串。
/// </summary> /// </summary>

View File

@@ -127,7 +127,7 @@
<value>Please check the server settings first</value> <value>Please check the server settings first</value>
</data> </data>
<data name="ConfigurationFormatIncorrect" xml:space="preserve"> <data name="ConfigurationFormatIncorrect" xml:space="preserve">
<value> configuration format is incorrect</value> <value>Invalid configuration format</value>
</data> </data>
<data name="CustomServerTips" xml:space="preserve"> <data name="CustomServerTips" xml:space="preserve">
<value>Note that custom configuration relies entirely on your own configuration and does not work with all settings. If you want to use the system proxy, please modify the listening port manually.</value> <value>Note that custom configuration relies entirely on your own configuration and does not work with all settings. If you want to use the system proxy, please modify the listening port manually.</value>
@@ -136,7 +136,7 @@
<value>Downloading...</value> <value>Downloading...</value>
</data> </data>
<data name="downloadSpeed" xml:space="preserve"> <data name="downloadSpeed" xml:space="preserve">
<value>DOWN</value> <value>Download</value>
</data> </data>
<data name="DownloadYesNo" xml:space="preserve"> <data name="DownloadYesNo" xml:space="preserve">
<value>Whether to download? {0}</value> <value>Whether to download? {0}</value>
@@ -214,10 +214,10 @@
<value>Test Results</value> <value>Test Results</value>
</data> </data>
<data name="LvTodayDownloadDataAmount" xml:space="preserve"> <data name="LvTodayDownloadDataAmount" xml:space="preserve">
<value>Today download traffic</value> <value>Download traffic today</value>
</data> </data>
<data name="LvTodayUploadDataAmount" xml:space="preserve"> <data name="LvTodayUploadDataAmount" xml:space="preserve">
<value>Today upload traffic</value> <value>Upload traffic today</value>
</data> </data>
<data name="LvTotalDownloadDataAmount" xml:space="preserve"> <data name="LvTotalDownloadDataAmount" xml:space="preserve">
<value>Total download traffic</value> <value>Total download traffic</value>
@@ -229,7 +229,7 @@
<value>Transport</value> <value>Transport</value>
</data> </data>
<data name="MediumFresh" xml:space="preserve"> <data name="MediumFresh" xml:space="preserve">
<value>MediumFresh</value> <value>Medium</value>
</data> </data>
<data name="MsgClearSubscription" xml:space="preserve"> <data name="MsgClearSubscription" xml:space="preserve">
<value>Clear original subscription content</value> <value>Clear original subscription content</value>
@@ -241,7 +241,7 @@
<value>Failed to import subscription content</value> <value>Failed to import subscription content</value>
</data> </data>
<data name="MsgGetSubscriptionSuccessfully" xml:space="preserve"> <data name="MsgGetSubscriptionSuccessfully" xml:space="preserve">
<value>Get the subscription content successfully</value> <value>Get subscription content successfully</value>
</data> </data>
<data name="MsgNoValidSubscription" xml:space="preserve"> <data name="MsgNoValidSubscription" xml:space="preserve">
<value>No valid subscriptions set</value> <value>No valid subscriptions set</value>
@@ -289,19 +289,19 @@
<value> This feature relies on the Http global proxy, please set it correctly first.</value> <value> This feature relies on the Http global proxy, please set it correctly first.</value>
</data> </data>
<data name="NonvmessOrssProtocol" xml:space="preserve"> <data name="NonvmessOrssProtocol" xml:space="preserve">
<value>Non-vmess or ss protocol</value> <value>Non-VMess or ss protocol</value>
</data> </data>
<data name="NonVmessService" xml:space="preserve"> <data name="NonVmessService" xml:space="preserve">
<value> non-Vmess service, this feature is invalid</value> <value> non-standard service, this feature is invalid</value>
</data> </data>
<data name="NotFoundCore" xml:space="preserve"> <data name="NotFoundCore" xml:space="preserve">
<value>Core not found, please download: {0}</value> <value>Core not found({0}), please download: {1}</value>
</data> </data>
<data name="NoValidQRcodeFound" xml:space="preserve"> <data name="NoValidQRcodeFound" xml:space="preserve">
<value>Scan completed, no valid QR code found</value> <value>Scan completed, no valid QR code found</value>
</data> </data>
<data name="OperationFailed" xml:space="preserve"> <data name="OperationFailed" xml:space="preserve">
<value> operation failed, please check retry</value> <value> operation failed, please check and retry</value>
</data> </data>
<data name="PleaseFillRemarks" xml:space="preserve"> <data name="PleaseFillRemarks" xml:space="preserve">
<value>Please Fill Remarks</value> <value>Please Fill Remarks</value>
@@ -310,13 +310,13 @@
<value>Please select the encryption method</value> <value>Please select the encryption method</value>
</data> </data>
<data name="PleaseSelectProtocol" xml:space="preserve"> <data name="PleaseSelectProtocol" xml:space="preserve">
<value>Please select an agreement</value> <value>Please select a protocol</value>
</data> </data>
<data name="PleaseSelectServer" xml:space="preserve"> <data name="PleaseSelectServer" xml:space="preserve">
<value>Please select the server first</value> <value>Please select the server first</value>
</data> </data>
<data name="QuickFresh" xml:space="preserve"> <data name="QuickFresh" xml:space="preserve">
<value>QuickFresh</value> <value>Fast</value>
</data> </data>
<data name="RemoveDuplicateServerResult" xml:space="preserve"> <data name="RemoveDuplicateServerResult" xml:space="preserve">
<value>Servers deduplication completed. Old: {0}, New: {1}.</value> <value>Servers deduplication completed. Old: {0}, New: {1}.</value>
@@ -331,23 +331,23 @@
<value>The server configuration file is saved at: {0}</value> <value>The server configuration file is saved at: {0}</value>
</data> </data>
<data name="SlowFresh" xml:space="preserve"> <data name="SlowFresh" xml:space="preserve">
<value>SlowFresh</value> <value>Slow</value>
</data> </data>
<data name="SpeedServerTips" xml:space="preserve"> <data name="SpeedServerTips" xml:space="preserve">
<value>Note: After this function relies on the Http global proxy test, please manually adjust the Http global proxy and active node!</value> <value>Note: This feature relies on the Http global proxy. Please manually adjust the Http global proxy and active node after testing.</value>
</data> </data>
<data name="StartPacFailed" xml:space="preserve"> <data name="StartPacFailed" xml:space="preserve">
<value>PAC failed to start. Run it with Admin right.</value> <value>PAC failed to start. Please run this program as Administrator.</value>
</data> </data>
<data name="StartService" xml:space="preserve"> <data name="StartService" xml:space="preserve">
<value>Start service ({0})...</value> <value>Start service ({0})...</value>
</data> </data>
<data name="SuccessfulConfiguration" xml:space="preserve"> <data name="SuccessfulConfiguration" xml:space="preserve">
<value>Successful configuration <value>Configuration successful
{0}</value> {0}</value>
</data> </data>
<data name="SuccessfullyImportedCustomServer" xml:space="preserve"> <data name="SuccessfullyImportedCustomServer" xml:space="preserve">
<value>Successfully imported custom configuration server</value> <value>Custom configuration server imported successfully.</value>
</data> </data>
<data name="SuccessfullyImportedServerViaClipboard" xml:space="preserve"> <data name="SuccessfullyImportedServerViaClipboard" xml:space="preserve">
<value>{0} servers have been imported from clipboard.</value> <value>{0} servers have been imported from clipboard.</value>
@@ -356,7 +356,7 @@
<value>Scan import URL successfully</value> <value>Scan import URL successfully</value>
</data> </data>
<data name="TestMeOutput" xml:space="preserve"> <data name="TestMeOutput" xml:space="preserve">
<value>The ping of current service: {0}</value> <value>The ping of current service: {0} ms</value>
</data> </data>
<data name="OperationSuccess" xml:space="preserve"> <data name="OperationSuccess" xml:space="preserve">
<value>Operation success</value> <value>Operation success</value>
@@ -389,7 +389,7 @@
<value>Download GeoFile: {0} successfully</value> <value>Download GeoFile: {0} successfully</value>
</data> </data>
<data name="MsgInformationTitle" xml:space="preserve"> <data name="MsgInformationTitle" xml:space="preserve">
<value>Informations (Filter : {0})</value> <value>Information (Filter : {0})</value>
</data> </data>
<data name="LvCustomIcon" xml:space="preserve"> <data name="LvCustomIcon" xml:space="preserve">
<value>Custom Icon</value> <value>Custom Icon</value>
@@ -457,4 +457,22 @@
<data name="SystemProxy" xml:space="preserve"> <data name="SystemProxy" xml:space="preserve">
<value>System proxy</value> <value>System proxy</value>
</data> </data>
<data name="Speedtesting" xml:space="preserve">
<value>Speed Test...</value>
</data>
<data name="TooManyServersTip" xml:space="preserve">
<value>Too many servers, please open the main interface</value>
</data>
<data name="LabLAN" xml:space="preserve">
<value>LAN</value>
</data>
<data name="LabLocal" xml:space="preserve">
<value>Local</value>
</data>
<data name="MsgServerTitle" xml:space="preserve">
<value>Servers (Filter : {0})</value>
</data>
<data name="NetFrameworkRequirementsTip" xml:space="preserve">
<value>Normal use of this version requires .NET Framework 4.8</value>
</data>
</root> </root>

View File

@@ -289,13 +289,13 @@
<value>此功能依赖Http全局代理,请先设置正确。</value> <value>此功能依赖Http全局代理,请先设置正确。</value>
</data> </data>
<data name="NonvmessOrssProtocol" xml:space="preserve"> <data name="NonvmessOrssProtocol" xml:space="preserve">
<value>非vmess或ss协议</value> <value>非VMess或ss协议</value>
</data> </data>
<data name="NonVmessService" xml:space="preserve"> <data name="NonVmessService" xml:space="preserve">
<value>非Vmess服务,此功能无效</value> <value>非标准服务,此功能无效</value>
</data> </data>
<data name="NotFoundCore" xml:space="preserve"> <data name="NotFoundCore" xml:space="preserve">
<value>找不到Core下载地址: {0}</value> <value>找不到Core(文件名:{0}),下载地址: {1}</value>
</data> </data>
<data name="NoValidQRcodeFound" xml:space="preserve"> <data name="NoValidQRcodeFound" xml:space="preserve">
<value>扫描完成,未发现有效二维码</value> <value>扫描完成,未发现有效二维码</value>
@@ -356,7 +356,7 @@
<value>扫描导入URL成功</value> <value>扫描导入URL成功</value>
</data> </data>
<data name="TestMeOutput" xml:space="preserve"> <data name="TestMeOutput" xml:space="preserve">
<value>当前服务的真连接延迟: {0}</value> <value>当前服务的真连接延迟: {0} ms</value>
</data> </data>
<data name="OperationSuccess" xml:space="preserve"> <data name="OperationSuccess" xml:space="preserve">
<value>操作成功</value> <value>操作成功</value>
@@ -457,4 +457,22 @@
<data name="SystemProxy" xml:space="preserve"> <data name="SystemProxy" xml:space="preserve">
<value>系统代理</value> <value>系统代理</value>
</data> </data>
<data name="Speedtesting" xml:space="preserve">
<value>测速中...</value>
</data>
<data name="TooManyServersTip" xml:space="preserve">
<value>服务器太多,请打开主界面操作</value>
</data>
<data name="LabLAN" xml:space="preserve">
<value>局域网</value>
</data>
<data name="LabLocal" xml:space="preserve">
<value>本地</value>
</data>
<data name="MsgServerTitle" xml:space="preserve">
<value>服务器 (过滤器 : {0})</value>
</data>
<data name="NetFrameworkRequirementsTip" xml:space="preserve">
<value>正常使用此版本需要.NET Framework 4.8,请更新后重启</value>
</data>
</root> </root>

View File

@@ -0,0 +1,18 @@
{
"tag": "tag1",
"port": 10808,
"protocol": "socks",
"listen": "127.0.0.1",
"settings": {
"auth": "noauth",
"udp": true,
"allowTransparent": false
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
}

View File

@@ -94,6 +94,10 @@ namespace v2rayN.Tool
} }
} }
} }
if (File.Exists(fileName))
{
File.Delete(fileName);
}
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@@ -13,23 +13,27 @@ namespace v2rayN.Tool
{ {
public static void Setup() public static void Setup()
{ {
Hierarchy hierarchy = (Hierarchy)LogManager.GetRepository(); var hierarchy = (Hierarchy)LogManager.GetRepository();
PatternLayout patternLayout = new PatternLayout(); var patternLayout = new PatternLayout
patternLayout.ConversionPattern = "%date [%thread] %-5level %logger - %message%newline"; {
ConversionPattern = "%date [%thread] %-5level %logger - %message%newline"
};
patternLayout.ActivateOptions(); patternLayout.ActivateOptions();
RollingFileAppender roller = new RollingFileAppender(); var roller = new RollingFileAppender
roller.AppendToFile = true; {
roller.RollingStyle = RollingFileAppender.RollingMode.Date; AppendToFile = true,
roller.DatePattern = "yyyy-MM-dd'.txt'"; RollingStyle = RollingFileAppender.RollingMode.Date,
roller.File = Utils.GetPath(@"guiLogs\"); DatePattern = "yyyy-MM-dd'.txt'",
roller.Layout = patternLayout; File = Utils.GetPath(@"guiLogs\"),
roller.StaticLogFileName = false; Layout = patternLayout,
StaticLogFileName = false
};
roller.ActivateOptions(); roller.ActivateOptions();
hierarchy.Root.AddAppender(roller); hierarchy.Root.AddAppender(roller);
MemoryAppender memory = new MemoryAppender(); var memory = new MemoryAppender();
memory.ActivateOptions(); memory.ActivateOptions();
hierarchy.Root.AddAppender(memory); hierarchy.Root.AddAppender(memory);

View File

@@ -23,6 +23,8 @@ using Newtonsoft.Json.Linq;
using System.Web; using System.Web;
using log4net; using log4net;
using System.Linq; using System.Linq;
using System.Security.Cryptography;
using System.Runtime.InteropServices;
namespace v2rayN namespace v2rayN
{ {
@@ -397,6 +399,20 @@ namespace v2rayN
{ {
return HttpUtility.UrlDecode(url); return HttpUtility.UrlDecode(url);
} }
public static string GetMD5(string str)
{
var md5 = MD5.Create();
byte[] byteOld = Encoding.UTF8.GetBytes(str);
byte[] byteNew = md5.ComputeHash(byteOld);
StringBuilder sb = new StringBuilder();
foreach (byte b in byteNew)
{
sb.Append(b.ToString("x2"));
}
return sb.ToString();
}
#endregion #endregion
@@ -529,7 +545,13 @@ namespace v2rayN
#region #region
private static string autoRunName = "v2rayNAutoRun"; private static string autoRunName
{
get
{
return $"v2rayNAutoRun_{GetMD5(StartupPath())}";
}
}
private static string autoRunRegPath private static string autoRunRegPath
{ {
get get
@@ -572,6 +594,12 @@ namespace v2rayN
{ {
try try
{ {
//clear
if (!RegReadValue(autoRunRegPath, "v2rayNAutoRun", "").IsNullOrEmpty())
{
RegWriteValue(autoRunRegPath, "v2rayNAutoRun", "");
}
string value = RegReadValue(autoRunRegPath, autoRunName, ""); string value = RegReadValue(autoRunRegPath, autoRunName, "");
string exePath = GetExePath(); string exePath = GetExePath();
if (value?.Equals(exePath) == true || value?.Equals($"\"{exePath}\"") == true) if (value?.Equals(exePath) == true || value?.Equals($"\"{exePath}\"") == true)
@@ -672,7 +700,7 @@ namespace v2rayN
/// </summary> /// </summary>
/// <param name="release">需要的版本4.6.2=394802;4.8=528040</param> /// <param name="release">需要的版本4.6.2=394802;4.8=528040</param>
/// <returns></returns> /// <returns></returns>
public static bool GetDotNetRelease(int release) public static bool CheckForDotNetVersion(int release = 528040)
{ {
const string subkey = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\"; const string subkey = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\";
using (RegistryKey ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(subkey)) using (RegistryKey ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(subkey))
@@ -685,6 +713,13 @@ namespace v2rayN
} }
} }
public static string MainMsgFilterKey
{
get
{
return $"MainMsgFilter_{GetMD5(StartupPath())}";
}
}
#endregion #endregion
#region #region
@@ -930,7 +965,7 @@ namespace v2rayN
public static string GetDownloadFileName(string url) public static string GetDownloadFileName(string url)
{ {
var fileName = System.IO.Path.GetFileName(url); var fileName = Path.GetFileName(url);
fileName += "_temp"; fileName += "_temp";
return fileName; return fileName;
@@ -961,7 +996,7 @@ namespace v2rayN
// return path to store temporary files // return path to store temporary files
public static string GetTempPath(string filename = "") public static string GetTempPath(string filename = "")
{ {
string _tempPath = Path.Combine(StartupPath(), "v2ray_win_temp"); string _tempPath = Path.Combine(StartupPath(), "guiTemps");
if (!Directory.Exists(_tempPath)) if (!Directory.Exists(_tempPath))
{ {
Directory.CreateDirectory(_tempPath); Directory.CreateDirectory(_tempPath);
@@ -1090,5 +1125,30 @@ namespace v2rayN
#endregion #endregion
#region Windows API
public static string WindowHwndKey
{
get
{
return $"WindowHwnd_{GetMD5(StartupPath())}";
}
}
[DllImport("user32.dll")]
public static extern bool SetProcessDPIAware();
[DllImport("user32.dll")]
public static extern int ShowWindow(IntPtr hwnd, int nCmdShow);
[DllImport("user32.dll")]
public static extern int SwitchToThisWindow(IntPtr hwnd, bool fUnknown);
[DllImport("user32.dll")]
public static extern bool IsWindow(IntPtr hwnd);
#endregion
} }
} }

View File

@@ -1,7 +0,0 @@
<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>

View File

@@ -1,489 +1,65 @@
<?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <TargetFramework>net48</TargetFramework>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <LangVersion>preview</LangVersion>
<ProjectGuid>{0A9785E6-D256-4B73-9757-4EF59955FD1E}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <UseWindowsForms>true</UseWindowsForms>
<RootNamespace>v2rayN</RootNamespace> <Copyright>Copyright © 2019-2022 (GPLv3)</Copyright>
<AssemblyName>v2rayN</AssemblyName> <FileVersion>5.38</FileVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<IsWebBootstrapper>false</IsWebBootstrapper>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<PublishUrl>发布\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<ApplicationIcon>v2rayN.ico</ApplicationIcon> <ApplicationIcon>v2rayN.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>BD431FE78E8A6683106E7110882AE5C41CBF5C60</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>v2rayN_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>false</SignManifests>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<TargetZone>LocalIntranet</TargetZone>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup />
<PropertyGroup>
<StartupObject>v2rayN.Program</StartupObject>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <None Remove="Sample\custom_routing_black" />
<Reference Include="System.Core" /> <None Remove="Sample\custom_routing_global" />
<Reference Include="System.Data.DataSetExtensions" /> <None Remove="Sample\custom_routing_locked" />
<Reference Include="Microsoft.CSharp" /> <None Remove="Sample\custom_routing_rules" />
<Reference Include="System.Data" /> <None Remove="Sample\custom_routing_white" />
<None Remove="Sample\SampleClientConfig.txt" />
<None Remove="Sample\SampleHttprequest.txt" />
<None Remove="Sample\SampleHttpresponse.txt" />
<None Remove="Sample\SampleInbound.txt" />
<None Remove="Sample\SampleServerConfig.txt" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Sample\custom_routing_black" />
<EmbeddedResource Include="Sample\custom_routing_global" />
<EmbeddedResource Include="Sample\custom_routing_locked" />
<EmbeddedResource Include="Sample\custom_routing_rules" />
<EmbeddedResource Include="Sample\custom_routing_white" />
<EmbeddedResource Include="Sample\SampleClientConfig.txt" />
<EmbeddedResource Include="Sample\SampleHttprequest.txt" />
<EmbeddedResource Include="Sample\SampleHttpresponse.txt" />
<EmbeddedResource Include="Sample\SampleInbound.txt" />
<EmbeddedResource Include="Sample\SampleServerConfig.txt" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Data.Linq" /> <Reference Include="System.Data.Linq" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" /> <Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Messaging" /> <Reference Include="System.Messaging" />
<Reference Include="System.Net" /> <Reference Include="System.Net" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.WebRequest" /> <Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Base\HttpClientHelper.cs" />
<Compile Include="Base\ListViewFlickerFree.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Forms\BaseServerForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\BaseServerForm.Designer.cs">
<DependentUpon>BaseServerForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\MsgFilterSetForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\MsgFilterSetForm.Designer.cs">
<DependentUpon>MsgFilterSetForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\RoutingRuleSettingDetailsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\RoutingRuleSettingDetailsForm.Designer.cs">
<DependentUpon>RoutingRuleSettingDetailsForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\GlobalHotkeySettingForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\GlobalHotkeySettingForm.Designer.cs">
<DependentUpon>GlobalHotkeySettingForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\RoutingRuleSettingForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\RoutingRuleSettingForm.Designer.cs">
<DependentUpon>RoutingRuleSettingForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\ServerTransportControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\ServerTransportControl.Designer.cs">
<DependentUpon>ServerTransportControl.cs</DependentUpon>
</Compile>
<Compile Include="Forms\GroupSettingControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\GroupSettingControl.Designer.cs">
<DependentUpon>GroupSettingControl.cs</DependentUpon>
</Compile>
<Compile Include="Forms\GroupSettingForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\GroupSettingForm.Designer.cs">
<DependentUpon>GroupSettingForm.cs</DependentUpon>
</Compile>
<Compile Include="Handler\LazyConfig.cs" />
<Compile Include="Handler\ShareHandler.cs" />
<Compile Include="Handler\UpdateHandle.cs" />
<Compile Include="Mode\ComboItem.cs" />
<Compile Include="Forms\MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\RoutingSettingForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\RoutingSettingForm.Designer.cs">
<DependentUpon>RoutingSettingForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\SubSettingForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\SubSettingForm.Designer.cs">
<DependentUpon>SubSettingForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\AddServer2Form.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\AddServer2Form.Designer.cs">
<DependentUpon>AddServer2Form.cs</DependentUpon>
</Compile>
<Compile Include="Forms\QRCodeControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\QRCodeControl.Designer.cs">
<DependentUpon>QRCodeControl.cs</DependentUpon>
</Compile>
<Compile Include="Forms\SubSettingControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\SubSettingControl.Designer.cs">
<DependentUpon>SubSettingControl.cs</DependentUpon>
</Compile>
<Compile Include="Handler\MainFormHandler.cs" />
<Compile Include="Handler\SpeedtestHandler.cs" />
<Compile Include="Handler\StatisticsHandler.cs" />
<Compile Include="Handler\DownloadHandle.cs" />
<Compile Include="Handler\ProxySetting.cs" />
<Compile Include="Handler\SysProxyHandle.cs" />
<Compile Include="Mode\ESpeedActionType.cs" />
<Compile Include="Mode\EGlobalHotkey.cs" />
<Compile Include="Mode\ECoreType.cs" />
<Compile Include="Mode\ESysProxyType.cs" />
<Compile Include="Mode\EMove.cs" />
<Compile Include="Mode\EServerColName.cs" />
<Compile Include="Mode\RoutingItem.cs" />
<Compile Include="Mode\RulesItem.cs" />
<Compile Include="Mode\ServerStatistics.cs" />
<Compile Include="Mode\CoreInfo.cs" />
<Compile Include="Mode\SysproxyConfig.cs" />
<Compile Include="Mode\EConfigType.cs" />
<Compile Include="Mode\ServerTestItem.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Resx\ResUI.zh-Hans.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>ResUI.zh-Hans.resx</DependentUpon>
</Compile>
<Compile Include="Resx\ResUI.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>ResUI.resx</DependentUpon>
</Compile>
<Compile Include="Base\StringEx.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Forms\AddServerForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\AddServerForm.Designer.cs">
<DependentUpon>AddServerForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\BaseForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\BaseForm.Designer.cs">
<DependentUpon>BaseForm.cs</DependentUpon>
</Compile>
<Compile Include="Global.cs" />
<Compile Include="Handler\QRCodeHelper.cs" />
<Compile Include="Mode\VmessQRCode.cs" />
<Compile Include="Mode\V2rayTcpRequest.cs" />
<Compile Include="Handler\ConfigHandler.cs" />
<Compile Include="Handler\V2rayHandler.cs" />
<Compile Include="Mode\V2rayConfig.cs" />
<Compile Include="Mode\Config.cs" />
<Compile Include="Forms\OptionSettingForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\OptionSettingForm.Designer.cs">
<DependentUpon>OptionSettingForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tool\FileManager.cs" />
<Compile Include="Tool\Job.cs" />
<Compile Include="Tool\Logging.cs" />
<Compile Include="Tool\QueryableExtension.cs" />
<Compile Include="Tool\UI.cs" />
<Compile Include="Tool\Utils.cs" />
<Compile Include="Handler\V2rayConfigHandler.cs" />
<EmbeddedResource Include="Forms\AddServer2Form.zh-Hans.resx">
<DependentUpon>AddServer2Form.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\AddServerForm.zh-Hans.resx">
<DependentUpon>AddServerForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\BaseServerForm.resx">
<DependentUpon>BaseServerForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\GlobalHotkeySettingForm.zh-Hans.resx">
<DependentUpon>GlobalHotkeySettingForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\MainForm.zh-Hans.resx">
<DependentUpon>MainForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\MsgFilterSetForm.resx">
<DependentUpon>MsgFilterSetForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\MsgFilterSetForm.zh-Hans.resx">
<DependentUpon>MsgFilterSetForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\OptionSettingForm.zh-Hans.resx">
<DependentUpon>OptionSettingForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\QRCodeControl.zh-Hans.resx">
<DependentUpon>QRCodeControl.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\RoutingRuleSettingDetailsForm.resx">
<DependentUpon>RoutingRuleSettingDetailsForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\RoutingRuleSettingDetailsForm.zh-Hans.resx">
<DependentUpon>RoutingRuleSettingDetailsForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\GlobalHotkeySettingForm.resx">
<DependentUpon>GlobalHotkeySettingForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\RoutingRuleSettingForm.resx">
<DependentUpon>RoutingRuleSettingForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\RoutingRuleSettingForm.zh-Hans.resx">
<DependentUpon>RoutingRuleSettingForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ServerTransportControl.resx">
<DependentUpon>ServerTransportControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ServerTransportControl.zh-Hans.resx">
<DependentUpon>ServerTransportControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\GroupSettingControl.resx">
<DependentUpon>GroupSettingControl.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\GroupSettingControl.zh-Hans.resx">
<DependentUpon>GroupSettingControl.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\SubSettingControl.resx">
<DependentUpon>SubSettingControl.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\SubSettingControl.zh-Hans.resx">
<DependentUpon>SubSettingControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\RoutingSettingForm.resx">
<DependentUpon>RoutingSettingForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\RoutingSettingForm.zh-Hans.resx">
<DependentUpon>RoutingSettingForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\GroupSettingForm.resx">
<DependentUpon>GroupSettingForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\GroupSettingForm.zh-Hans.resx">
<DependentUpon>GroupSettingForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\SubSettingForm.resx">
<DependentUpon>SubSettingForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\AddServerForm.resx">
<DependentUpon>AddServerForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\BaseForm.resx">
<DependentUpon>BaseForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\OptionSettingForm.resx">
<DependentUpon>OptionSettingForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\QRCodeControl.resx">
<DependentUpon>QRCodeControl.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\AddServer2Form.resx">
<DependentUpon>AddServer2Form.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\SubSettingForm.zh-Hans.resx">
<DependentUpon>SubSettingForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="app.config">
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<None Include="Resources\sysproxy.exe.gz" />
<None Include="Resources\sysproxy64.exe.gz" />
<EmbeddedResource Include="Sample\custom_routing_white" />
<EmbeddedResource Include="Sample\custom_routing_global" />
<EmbeddedResource Include="Sample\custom_routing_locked" />
<EmbeddedResource Include="Sample\custom_routing_black" />
<Protobuf Include="Protos\Statistics.proto" /> <Protobuf Include="Protos\Statistics.proto" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resx\ResUI.zh-Hans.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>ResUI.zh-Hans.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Resx\ResUI.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>ResUI.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="v2rayN.ico" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Sample\SampleClientConfig.txt" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Sample\SampleHttprequest.txt" />
<EmbeddedResource Include="Sample\SampleHttpresponse.txt" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4 %28x86 和 x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.4.5">
<Visible>False</Visible>
<ProductName>Windows Installer 4.5</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Sample\SampleServerConfig.txt" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\restart.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\option.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\server.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\minimize.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\share.png" />
<None Include="Resources\promotion.png" />
<None Include="Resources\sub.png" />
<None Include="Resources\checkupdate.png" />
<None Include="Resources\about.png" />
<Content Include="Resources\help.png" />
<None Include="Resources\notify.png" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Google.Protobuf"> <PackageReference Include="Google.Protobuf">
<Version>3.19.4</Version> <Version>3.21.5</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Grpc.Core"> <PackageReference Include="Grpc.Core">
<Version>2.44.0</Version> <Version>2.46.3</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Grpc.Tools"> <PackageReference Include="Grpc.Tools">
<Version>2.44.0</Version> <Version>2.47.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="log4net"> <PackageReference Include="log4net">
<Version>2.0.14</Version> <Version>2.0.15</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Newtonsoft.Json"> <PackageReference Include="Newtonsoft.Json">
<Version>13.0.1</Version> <Version>13.0.1</Version>
@@ -498,19 +74,9 @@
<Version>0.16.8</Version> <Version>0.16.8</Version>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>copy /y $(SolutionDir)v2rayUpgrade\$(OutDir)* $(TargetDir) <PostBuildEvent>del $(TargetDir)*.xml $(TargetDir)*.so $(TargetDir)*.dylib
del $(TargetDir)*.xml $(TargetDir)*.so $(TargetDir)*.dylib
if not "$(ConfigurationName)" == "Debug" del $(TargetDir)*.pdb</PostBuildEvent> if not "$(ConfigurationName)" == "Debug" del $(TargetDir)*.pdb</PostBuildEvent>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<Import Project="..\packages\Grpc.Core.2.23.0\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.2.23.0\build\net45\Grpc.Core.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project> </Project>

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>发布\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>zh-CN</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
<PropertyGroup>
<EnableSecurityDebugging>false</EnableSecurityDebugging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartAction>Project</StartAction>
<StartArguments>
</StartArguments>
</PropertyGroup>
</Project>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>

View File

@@ -37,6 +37,7 @@
// btnClose // btnClose
// //
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnClose.Font = new System.Drawing.Font("微软雅黑", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClose.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.btnClose.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.btnClose.Location = new System.Drawing.Point(367, 118); this.btnClose.Location = new System.Drawing.Point(367, 118);
this.btnClose.Name = "btnClose"; this.btnClose.Name = "btnClose";
@@ -48,6 +49,7 @@
// //
// btnOK // btnOK
// //
this.btnOK.Font = new System.Drawing.Font("微软雅黑", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOK.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.btnOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.btnOK.Location = new System.Drawing.Point(81, 118); this.btnOK.Location = new System.Drawing.Point(81, 118);
this.btnOK.Name = "btnOK"; this.btnOK.Name = "btnOK";
@@ -60,7 +62,7 @@
// label1 // label1
// //
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label1.Font = new System.Drawing.Font("微软雅黑", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(79, 64); this.label1.Location = new System.Drawing.Point(79, 64);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(205, 15); this.label1.Size = new System.Drawing.Size(205, 15);
@@ -70,7 +72,7 @@
// label2 // label2
// //
this.label2.AutoSize = true; this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label2.Font = new System.Drawing.Font("微软雅黑", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(79, 37); this.label2.Location = new System.Drawing.Point(79, 37);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(471, 15); this.label2.Size = new System.Drawing.Size(471, 15);

View File

@@ -1,34 +0,0 @@
using System.Reflection;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("v2rayUpgrade")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("v2rayUpgrade")]
[assembly: AssemblyCopyright("Copyright © 2019-2020 (GPLv3)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("f82be52a-155c-492c-9e0a-1e917ec62c78")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.1.0.0")]

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:application>
<asmv3:windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>

View File

@@ -1,89 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk">
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <TargetFramework>net48</TargetFramework>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F82BE52A-155C-492C-9E0A-1E917EC62C78}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>v2rayUpgrade</RootNamespace> <UseWindowsForms>true</UseWindowsForms>
<AssemblyName>v2rayUpgrade</AssemblyName> <Copyright>Copyright © 2019-2020 (GPLv3)</Copyright>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <FileVersion>1.1.0.0</FileVersion>
<FileAlignment>512</FileAlignment> <ApplicationManifest>app.manifest</ApplicationManifest>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" /> <Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartArguments>C:\Githubb\v2rayN\v2rayN\v2rayUpgrade\bin\Debug\v2ray-windows.zip</StartArguments>
</PropertyGroup>
</Project>