mirror of
https://git.oceanpay.cc/danial/kami_itunes_june.git
synced 2025-12-18 22:31:24 +00:00
- 在.settings.local.json中添加dotnet clean命令权限 - 更新项目文件以启用不安全的二进制序列化和禁用平台兼容性警告 - 配置调试和发布模式的编译常量及优化选项 - 在解决方案文件中升级Visual Studio版本并添加多平台配置 - 移除FormLogin构造函数中的MessageBox调试代码 - 为过时的WebRequest、WebClient和ServicePointManager API添加编译警告抑制 - 简化异常处理逻辑并在Program.cs中改进启动流程 - 移除多个未使用的局部变量声明 - 添加launchSettings.json以支持开发环境配置 - 在表单构造函数中初始化components容器 - 优化网络请求超时设置并改善错误处理机制
1333 lines
47 KiB
C#
1333 lines
47 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.ComponentModel;
|
||
using System.Diagnostics;
|
||
using System.Drawing;
|
||
using System.IO;
|
||
using System.Linq;
|
||
using System.Net;
|
||
using System.Text.RegularExpressions;
|
||
using System.Threading;
|
||
using System.Threading.Tasks;
|
||
using System.Windows.Forms;
|
||
using AppleBatch_June.ExecuteTasks;
|
||
using AppleBatch_June.Model;
|
||
using AppleBatch_June.Utils;
|
||
using DotNet.Utilities;
|
||
|
||
namespace AppleBatch_June
|
||
{
|
||
public class FormNetwork : Form
|
||
{
|
||
private string RadioHttpAgentRouteLine = "";
|
||
|
||
private IContainer components;
|
||
|
||
private Label label2;
|
||
|
||
private ComboBox comNetworkConfig;
|
||
|
||
private Button btnSaveSetting;
|
||
|
||
private Button btnClose;
|
||
|
||
private TabControl tabConfig;
|
||
|
||
private TabPage pageApi;
|
||
|
||
private TabPage pageSuidao;
|
||
|
||
private TabPage pageBohao;
|
||
|
||
private TextBox txtAdslIdCount;
|
||
|
||
private Label label8;
|
||
|
||
private Button btnAdslTest;
|
||
|
||
private TextBox txtAdslPwd;
|
||
|
||
private Label label6;
|
||
|
||
private TextBox txtAdslUserName;
|
||
|
||
private Label label7;
|
||
|
||
private TextBox txtTpsPwd;
|
||
|
||
private Label label9;
|
||
|
||
private Button btnTpsTest;
|
||
|
||
private TextBox txtTpsUserName;
|
||
|
||
private Label label10;
|
||
|
||
private TextBox txtTpsHost;
|
||
|
||
private Label label11;
|
||
|
||
private Button btnNetWorkApiTest;
|
||
|
||
private TextBox txtNetWordApiURL;
|
||
|
||
private Label label12;
|
||
|
||
private Label label13;
|
||
|
||
private Label label14;
|
||
|
||
private TextBox txtNowIp;
|
||
|
||
private LinkLabel linkLabel1;
|
||
|
||
private GroupBox groupBox3;
|
||
|
||
private RichTextBox txtLog;
|
||
|
||
private TextBox txtTpsPort;
|
||
|
||
private Label label1;
|
||
|
||
private Button button1;
|
||
|
||
private Button button2;
|
||
|
||
private Label label3;
|
||
|
||
private Label label50;
|
||
|
||
private Label labProxyThreadTip;
|
||
|
||
private TabPage pageDefault;
|
||
|
||
private Label label5;
|
||
|
||
private TextBox txtThredSize;
|
||
|
||
private TextBox txtApiAccountPwd;
|
||
|
||
private Label label4;
|
||
|
||
private TextBox txtApiAccountName;
|
||
|
||
private Label label16;
|
||
|
||
private Label label15;
|
||
|
||
private Panel panel1;
|
||
|
||
private RadioButton radWebProtocolOld;
|
||
|
||
private RadioButton radWebProtocolS2K;
|
||
|
||
private RadioButton radWebProtocolDefault;
|
||
|
||
public FormNetwork()
|
||
{
|
||
InitializeComponent();
|
||
}
|
||
|
||
private void FormNetwork_Load(object sender, EventArgs e)
|
||
{
|
||
int selectedIndex = Tools.ToNetWorkInt(ConfigUtlis.getConfigValue("comNetworkConfig"), 0);
|
||
txtNetWordApiURL.Text = Tools.ToUrlDecode(ConfigUtlis.getConfigValue("txtNetWordApiURL"));
|
||
RadioButton radioButton = radWebProtocolS2K;
|
||
RadioButton radioButton2 = radWebProtocolOld;
|
||
radWebProtocolDefault.Checked = false;
|
||
radioButton2.Checked = false;
|
||
radioButton.Checked = false;
|
||
string configValue = ConfigUtlis.getConfigValue("webProtocol");
|
||
if (AppSysConfig.getConfig("DefaultWebProtocolType") == "1")
|
||
{
|
||
radWebProtocolDefault.Text += " (新)";
|
||
}
|
||
else
|
||
{
|
||
radWebProtocolDefault.Text += " (旧)";
|
||
}
|
||
if (!string.IsNullOrEmpty(configValue))
|
||
{
|
||
if (configValue == "s2k")
|
||
{
|
||
radWebProtocolS2K.Checked = true;
|
||
}
|
||
else
|
||
{
|
||
radWebProtocolOld.Checked = true;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
radWebProtocolDefault.Checked = true;
|
||
}
|
||
txtApiAccountName.Text = Tools.ToUrlDecode(ConfigUtlis.getConfigValue("txtApiAccountName"));
|
||
txtApiAccountPwd.Text = Tools.ToUrlDecode(ConfigUtlis.getConfigValue("txtApiAccountPwd"));
|
||
txtTpsHost.Text = Tools.ToUrlDecode(ConfigUtlis.getConfigValue("txtTpsHost"));
|
||
txtTpsPort.Text = ConfigUtlis.getConfigValue("txtTpsPort");
|
||
txtTpsUserName.Text = ConfigUtlis.getConfigValue("txtTpsUserName");
|
||
txtTpsPwd.Text = ConfigUtlis.getConfigValue("txtTpsPwd");
|
||
txtAdslUserName.Text = ConfigUtlis.getConfigValue("txtAdslUserName");
|
||
txtAdslPwd.Text = ConfigUtlis.getConfigValue("txtAdslPwd");
|
||
txtAdslIdCount.Text = ConfigUtlis.getConfigValue("txtAdslIdCount");
|
||
if (string.IsNullOrEmpty(txtAdslIdCount.Text))
|
||
{
|
||
txtAdslIdCount.Text = "10";
|
||
}
|
||
string configValue2 = ConfigUtlis.getConfigValue("HttpAgentRouteLine");
|
||
int num = Tools.ToInt(ConfigUtlis.getConfigValue("ThredSize"), 4);
|
||
txtThredSize.Text = num.ToString();
|
||
int num2 = 0;
|
||
string config = AppSysConfig.getConfig("HttpAgentRoute");
|
||
int num3 = 20;
|
||
int num4 = 80;
|
||
string[] array = config.Split('|');
|
||
for (int i = 0; i < array.Length; i++)
|
||
{
|
||
string[] array2 = array[i].Split(',');
|
||
if (array2.Length == 3)
|
||
{
|
||
if (!(configValue2 == array2[0]) && (!string.IsNullOrEmpty(configValue2) || num2 != 0))
|
||
{
|
||
addCkeckBox(array2[1] + "(" + array2[0] + ")", num3, ckSate: false, array2[0], num4);
|
||
}
|
||
else
|
||
{
|
||
addCkeckBox(array2[1] + "(" + array2[0] + ")", num3, ckSate: true, array2[0], num4);
|
||
}
|
||
num3 += int.Parse(array2[2]);
|
||
num2++;
|
||
if (num2 == 4)
|
||
{
|
||
num3 = 20;
|
||
num4 = 120;
|
||
}
|
||
}
|
||
}
|
||
comNetworkConfig.SelectedIndex = selectedIndex;
|
||
string config2 = AppSysConfig.getConfig("SystemProxyThredSize");
|
||
string config3 = AppSysConfig.getConfig("OtherProxyThredSize");
|
||
string config4 = AppSysConfig.getConfig("ThredSizeDefault");
|
||
labProxyThreadTip.Text = labProxyThreadTip.Text.Replace("{sys}", config2).Replace("{other}", config3).Replace("{default}", config4);
|
||
getNowIp();
|
||
}
|
||
|
||
private async void getNowIp()
|
||
{
|
||
txtNowIp.Text = "加载中...";
|
||
string text = await Task.Run(delegate
|
||
{
|
||
IpInfoModel ipInfoModel = ProxyRunService.loadIPInfo();
|
||
return (ipInfoModel == null) ? "获取失败" : ipInfoModel.ip;
|
||
});
|
||
txtNowIp.Text = text;
|
||
}
|
||
|
||
private void tabPage3_Click(object sender, EventArgs e)
|
||
{
|
||
}
|
||
|
||
private void btnNetWorkApiTest_Click(object sender, EventArgs e)
|
||
{
|
||
if (checkNetApi(txtNetWordApiURL.Text))
|
||
{
|
||
HttpHelper httpHelper = new HttpHelper();
|
||
HttpItem httpItem = new HttpItem
|
||
{
|
||
URL = txtNetWordApiURL.Text,
|
||
Method = "GET",
|
||
Timeout = 20000,
|
||
ReadWriteTimeout = 20000,
|
||
UserAgent = "liuyeu_proxy_AppleBatch_June"
|
||
};
|
||
httpItem.Header.Add("liyueToken", ProxyRunService.getVerifyToken("checkNetApi"));
|
||
HttpResult html = httpHelper.GetHtml(httpItem);
|
||
insertLog(string.Concat("测试提取IP返回:", html.StatusCode, "\n", html.Html));
|
||
}
|
||
}
|
||
|
||
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||
{
|
||
Clipboard.SetText(txtNowIp.Text);
|
||
MessageBox.Show("当前IP复制成功");
|
||
}
|
||
|
||
private void comNetworkConfig_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
hideAllPage();
|
||
switch (comNetworkConfig.SelectedIndex)
|
||
{
|
||
case 0:
|
||
tabConfig.SelectedIndex = 0;
|
||
txtThredSize.Enabled = true;
|
||
pageDefault.Enabled = true;
|
||
tabConfig.SelectedIndex = 0;
|
||
break;
|
||
case 1:
|
||
txtThredSize.Enabled = true;
|
||
pageApi.Enabled = true;
|
||
tabConfig.SelectedIndex = 1;
|
||
break;
|
||
case 2:
|
||
txtThredSize.Enabled = true;
|
||
pageSuidao.Enabled = true;
|
||
tabConfig.SelectedIndex = 2;
|
||
break;
|
||
case 3:
|
||
if (!File.Exists(AppDomain.CurrentDomain.BaseDirectory + "DotRas.dll"))
|
||
{
|
||
if (MessageBox.Show("没有宽带拨号插件,是否下载?下载会关闭程序", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
|
||
{
|
||
StartProcess("update.exe", new string[2]
|
||
{
|
||
ApiNetReq.host + "/AppleClientApi/getUpFile?version=1.0.0",
|
||
"AppleBatch_June.exe"
|
||
});
|
||
Close();
|
||
Environment.Exit(0);
|
||
}
|
||
else
|
||
{
|
||
pageBohao.Enabled = false;
|
||
tabConfig.SelectedIndex = 0;
|
||
comNetworkConfig.SelectedIndex = 0;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
pageBohao.Enabled = true;
|
||
tabConfig.SelectedIndex = 3;
|
||
}
|
||
break;
|
||
}
|
||
txtThredSize_TextChanged(null, null);
|
||
}
|
||
|
||
private bool StartProcess(string filename, string[] args)
|
||
{
|
||
try
|
||
{
|
||
string text = "";
|
||
foreach (string text2 in args)
|
||
{
|
||
text = text + text2 + " ";
|
||
}
|
||
text = text.Trim();
|
||
Process process = new Process();
|
||
ProcessStartInfo startInfo = new ProcessStartInfo(filename, text);
|
||
process.StartInfo = startInfo;
|
||
process.StartInfo.UseShellExecute = false;
|
||
process.Start();
|
||
return true;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
APIUtlis.ApiSeriveError(ex);
|
||
MessageBox.Show("启动应用程序时出错!原因:" + ex.Message);
|
||
}
|
||
return false;
|
||
}
|
||
|
||
private void hideAllPage()
|
||
{
|
||
pageApi.Enabled = false;
|
||
pageBohao.Enabled = false;
|
||
pageSuidao.Enabled = false;
|
||
txtThredSize.Enabled = false;
|
||
pageDefault.Enabled = false;
|
||
}
|
||
|
||
public void insertLog(string logText)
|
||
{
|
||
if (!base.IsDisposed && base.IsHandleCreated)
|
||
{
|
||
BeginInvoke((Action)delegate
|
||
{
|
||
txtLog.Text = txtLog.Text.Insert(0, DateTime.Now.ToString("HH:mm:ss") + " " + logText + "\n");
|
||
});
|
||
}
|
||
}
|
||
|
||
private void btnSaveSetting_Click(object sender, EventArgs e)
|
||
{
|
||
if (MessageBox.Show("确定使用 " + comNetworkConfig.Text + " 吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
|
||
{
|
||
return;
|
||
}
|
||
#pragma warning disable SYSLIB0014 // ServicePointManager is obsolete in .NET 5+
|
||
Console.WriteLine("DefaultConnectionLimit:" + ServicePointManager.DefaultConnectionLimit);
|
||
#pragma warning restore SYSLIB0014 // ServicePointManager is obsolete in .NET 5+
|
||
ProxyRunService.resetProxyData();
|
||
ProxyAccountCache.ReclassifyAccountAll();
|
||
int thredSizeNum = 2;
|
||
if (!SaveNetConfig(out thredSizeNum))
|
||
{
|
||
return;
|
||
}
|
||
ConfigUtlis.saveConfigKey("ThredSize", thredSizeNum.ToString());
|
||
ConfigUtlis.saveConfigKey("comNetworkConfig", comNetworkConfig.SelectedIndex.ToString());
|
||
ThreadPool.SetMinThreads(Tools.getTaskSize(openVpn: true, 1000) * 2, Tools.getTaskSize(openVpn: true, 1000));
|
||
string text = radWebProtocolDefault.Text;
|
||
if (!radWebProtocolDefault.Checked)
|
||
{
|
||
text = ((!radWebProtocolS2K.Checked) ? (text = radWebProtocolOld.Text.ToString()) : (text = radWebProtocolS2K.Text.ToString()));
|
||
if (radWebProtocolS2K.Checked)
|
||
{
|
||
AppSysConfig.webProtocolS2k = true;
|
||
ConfigUtlis.saveConfigKey("webProtocol", "s2k");
|
||
}
|
||
else
|
||
{
|
||
ConfigUtlis.saveConfigKey("webProtocol", "old");
|
||
AppSysConfig.webProtocolS2k = false;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
ConfigUtlis.saveConfigKey("webProtocol", "");
|
||
AppSysConfig.webProtocolS2k = ((AppSysConfig.getConfig("DefaultWebProtocolType") == "1") ? true : false);
|
||
}
|
||
insertLog("配置保存成功,当前使用的代理模式是:" + comNetworkConfig.Text + ",线程数量是:" + Tools.getTaskSize(openVpn: true, 1000) + ",登录协议:" + text + "\n提示:只有勾选 【 使用随机IP代理 】 时才会使用配置的代理 ");
|
||
MessageBox.Show("保存成功");
|
||
}
|
||
|
||
private bool SaveNetConfig(out int thredSizeNum)
|
||
{
|
||
int num = 2;
|
||
if (comNetworkConfig.SelectedIndex != 1 && comNetworkConfig.SelectedIndex != 2 && comNetworkConfig.SelectedIndex != 0)
|
||
{
|
||
num = Tools.ToInt(AppSysConfig.getConfig("ThredSizeDefault"), 2);
|
||
ConfigUtlis.saveConfigKey("HttpAgentRouteLine", RadioHttpAgentRouteLine);
|
||
}
|
||
else
|
||
{
|
||
num = ((!int.TryParse(txtThredSize.Text, out var result)) ? Tools.ToInt(AppSysConfig.getConfig("ThredSizeDefault"), 2) : result);
|
||
if (comNetworkConfig.SelectedIndex == 0)
|
||
{
|
||
ConfigUtlis.saveConfigKey("HttpAgentRouteLine", RadioHttpAgentRouteLine);
|
||
}
|
||
}
|
||
thredSizeNum = num;
|
||
switch (comNetworkConfig.SelectedIndex)
|
||
{
|
||
case 0:
|
||
return true;
|
||
case 1:
|
||
txtNetWordApiURL.Text.Trim();
|
||
if (checkNetApi(txtNetWordApiURL.Text))
|
||
{
|
||
ConfigUtlis.saveConfigKey("txtNetWordApiURL", Tools.ToUrlEncode(txtNetWordApiURL.Text.Trim()));
|
||
ConfigUtlis.saveConfigKey("txtApiAccountName", txtApiAccountName.Text.Trim());
|
||
ConfigUtlis.saveConfigKey("txtApiAccountPwd", txtApiAccountPwd.Text.Trim());
|
||
return true;
|
||
}
|
||
break;
|
||
case 2:
|
||
if (checkTps(txtTpsHost.Text, txtTpsPort.Text, txtTpsUserName.Text, txtTpsPwd.Text))
|
||
{
|
||
ConfigUtlis.saveConfigKey("txtTpsHost", Tools.ToUrlEncode(txtTpsHost.Text.Trim()));
|
||
ConfigUtlis.saveConfigKey("txtTpsPort", txtTpsPort.Text.Trim());
|
||
ConfigUtlis.saveConfigKey("txtTpsUserName", txtTpsUserName.Text.Trim());
|
||
ConfigUtlis.saveConfigKey("txtTpsPwd", txtTpsPwd.Text.Trim());
|
||
return true;
|
||
}
|
||
break;
|
||
case 3:
|
||
if (checkAdsl(txtAdslUserName.Text, txtAdslPwd.Text, txtAdslIdCount.Text))
|
||
{
|
||
ConfigUtlis.saveConfigKey("txtAdslUserName", txtAdslUserName.Text.Trim());
|
||
ConfigUtlis.saveConfigKey("txtAdslPwd", txtAdslPwd.Text.Trim());
|
||
ConfigUtlis.saveConfigKey("txtAdslIdCount", txtAdslIdCount.Text.Trim());
|
||
return true;
|
||
}
|
||
break;
|
||
}
|
||
return false;
|
||
}
|
||
|
||
private bool checkNetApi(string netWordApiURL)
|
||
{
|
||
if (!string.IsNullOrEmpty(netWordApiURL))
|
||
{
|
||
if (!netWordApiURL.StartsWith("http://", StringComparison.OrdinalIgnoreCase) && !netWordApiURL.StartsWith("https://", StringComparison.OrdinalIgnoreCase))
|
||
{
|
||
MessageBox.Show("API提取地址格式不正确");
|
||
return false;
|
||
}
|
||
return true;
|
||
}
|
||
MessageBox.Show("请选输入API提取地址");
|
||
return false;
|
||
}
|
||
|
||
private bool checkTps(string host, string proty, string userName, string pwd)
|
||
{
|
||
if (!string.IsNullOrEmpty(host))
|
||
{
|
||
if (int.TryParse(proty, out var _))
|
||
{
|
||
if (!string.IsNullOrEmpty(host))
|
||
{
|
||
if (!string.IsNullOrEmpty(host))
|
||
{
|
||
return true;
|
||
}
|
||
MessageBox.Show("请输入密码");
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("请输入用户名");
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("请输入正确的端口号");
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("请输入隧道地址");
|
||
}
|
||
return false;
|
||
}
|
||
|
||
private bool checkAdsl(string adslUserName, string adsalPwd, string adslCount)
|
||
{
|
||
if (!string.IsNullOrEmpty(adslUserName))
|
||
{
|
||
if (int.TryParse(adslCount, out var _))
|
||
{
|
||
if (!string.IsNullOrEmpty(adslCount))
|
||
{
|
||
return true;
|
||
}
|
||
MessageBox.Show("请输入密码");
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("请输入正确的数量");
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("请输入宽带账号");
|
||
}
|
||
return false;
|
||
}
|
||
|
||
private void btnClose_Click(object sender, EventArgs e)
|
||
{
|
||
Close();
|
||
}
|
||
|
||
private void btnTpsTest_Click(object sender, EventArgs e)
|
||
{
|
||
if (checkTps(txtTpsHost.Text, txtTpsPort.Text, txtTpsUserName.Text, txtTpsPwd.Text))
|
||
{
|
||
WebProxy webProxy = new WebProxy();
|
||
if (!txtTpsHost.Text.StartsWith("http://", StringComparison.OrdinalIgnoreCase) && !txtTpsHost.Text.StartsWith("https://", StringComparison.OrdinalIgnoreCase))
|
||
{
|
||
webProxy.Address = new Uri($"http://{txtTpsHost.Text}:{txtTpsPort.Text}");
|
||
}
|
||
else
|
||
{
|
||
webProxy.Address = new Uri($"{txtTpsHost.Text}:{txtTpsPort.Text}");
|
||
}
|
||
webProxy.Credentials = new NetworkCredential(txtTpsUserName.Text, txtTpsPwd.Text);
|
||
HttpHelper httpHelper = new HttpHelper();
|
||
HttpItem httpItem = new HttpItem
|
||
{
|
||
URL = "http://myip.top",
|
||
Method = "GET",
|
||
Timeout = 30000,
|
||
ReadWriteTimeout = 30000,
|
||
WebProxy = webProxy
|
||
};
|
||
httpItem.KeepAlive = false;
|
||
HttpResult html = httpHelper.GetHtml(httpItem);
|
||
insertLog(string.Concat("隧道地址测试返回: ", html.StatusCode, " \n", html.Html));
|
||
}
|
||
}
|
||
|
||
private void btnAdslTest_Click(object sender, EventArgs e)
|
||
{
|
||
if (checkAdsl(txtAdslUserName.Text, txtAdslPwd.Text, txtAdslIdCount.Text))
|
||
{
|
||
insertLog("断开宽带连接");
|
||
RasTools.Disconnect();
|
||
insertLog("开始宽带重新拨号");
|
||
if (RasTools.Connect(txtAdslUserName.Text.Trim(), txtAdslPwd.Text.Trim(), out var errMsg))
|
||
{
|
||
insertLog("重新拨号成功");
|
||
}
|
||
else
|
||
{
|
||
insertLog("拨号失败:" + errMsg);
|
||
}
|
||
}
|
||
}
|
||
|
||
private void button1_Click(object sender, EventArgs e)
|
||
{
|
||
HttpHelper httpHelper = new HttpHelper();
|
||
HttpItem item = new HttpItem
|
||
{
|
||
URL = "http://myip.top/",
|
||
Method = "GET",
|
||
Timeout = 30000,
|
||
ReadWriteTimeout = 30000,
|
||
WebProxy = WebRequest.DefaultWebProxy
|
||
};
|
||
HttpResult html = httpHelper.GetHtml(item);
|
||
insertLog(string.Concat("测试获取IP返回: ", html.StatusCode, " \n", html.Html));
|
||
}
|
||
|
||
public List<ProxyIpModel> getIPListArray(string IpReust, string authenUserInfo)
|
||
{
|
||
int num = 10;
|
||
List<ProxyIpModel> list = new List<ProxyIpModel>();
|
||
Regex regex = new Regex("((?:(?:25[0-5]|2[0-4]\\d|((1\\d{2})|([1-9]?\\d)))\\.){3}(?:25[0-5]|2[0-4]\\d|((1\\d{2})|([1-9]?\\d))))");
|
||
string value = new Regex("\\[([\\s\\S]*?)\\]").Match(IpReust).Groups[1].Value;
|
||
string[] array;
|
||
if (!string.IsNullOrEmpty(value))
|
||
{
|
||
try
|
||
{
|
||
dynamic val = Tools.Todejosn<object>(("[" + value + "]").ToLower());
|
||
ApiJsonParameterPase(AppSysConfig.getConfig("GetApiJsonParameter"), out var ipParameter, out var proParameter, out var expireTimeParameter);
|
||
foreach (object item in val)
|
||
{
|
||
Dictionary<string, object> dictionary = (Dictionary<string, object>)(dynamic)item;
|
||
string text = "";
|
||
array = ipParameter;
|
||
foreach (string key in array)
|
||
{
|
||
if (dictionary.ContainsKey(key))
|
||
{
|
||
text = (dynamic)dictionary[key];
|
||
break;
|
||
}
|
||
}
|
||
int num2 = 0;
|
||
array = proParameter;
|
||
foreach (string key2 in array)
|
||
{
|
||
if (dictionary.ContainsKey(key2))
|
||
{
|
||
dynamic val2 = dictionary[key2];
|
||
if (val2 is int)
|
||
{
|
||
num2 = val2;
|
||
}
|
||
else
|
||
{
|
||
_ = (string)val2;
|
||
int.TryParse(val2, out num2);
|
||
}
|
||
break;
|
||
}
|
||
}
|
||
string text2 = "";
|
||
array = expireTimeParameter;
|
||
foreach (string key3 in array)
|
||
{
|
||
if (dictionary.ContainsKey(key3))
|
||
{
|
||
text2 = (dynamic)dictionary[key3];
|
||
break;
|
||
}
|
||
}
|
||
if (string.IsNullOrEmpty(text2) && dictionary.ContainsKey("timeout"))
|
||
{
|
||
int? num3 = dictionary["timeout"] as int?;
|
||
if (num3.HasValue)
|
||
{
|
||
text2 = DateTime.Now.AddSeconds(num3.Value).ToString("yyyy-MM-dd HH:mm:ss");
|
||
}
|
||
}
|
||
if (text2.Contains("addMinTime".ToLower()))
|
||
{
|
||
int num4 = Tools.ToInt(new Regex("\\(([\\s\\S]*?)\\)", RegexOptions.IgnoreCase).Match(text2).Groups[1].Value, 0);
|
||
if (num4 > 0)
|
||
{
|
||
text2 = DateTime.Now.AddMinutes(num4).ToString("yyyy-MM-dd HH:mm:ss");
|
||
}
|
||
}
|
||
if (num2 > 0 && !text.Contains(":"))
|
||
{
|
||
text = text + ":" + num2;
|
||
}
|
||
if (!string.IsNullOrEmpty(authenUserInfo))
|
||
{
|
||
text = authenUserInfo + "@" + text;
|
||
}
|
||
if (text.Substring(text.IndexOf('@') + 1).Split(':').Length == 2 && regex.IsMatch(text.Substring(text.IndexOf('@') + 1).Split(':')[0]))
|
||
{
|
||
DateTime? expirationTime = null;
|
||
if (DateTime.TryParse(text2, out var result))
|
||
{
|
||
expirationTime = ((!(result > DateTime.Now.AddMinutes(num))) ? new DateTime?(result) : new DateTime?(DateTime.Now.AddMinutes(num)));
|
||
}
|
||
list.Add(new ProxyIpModel
|
||
{
|
||
expirationTime = expirationTime,
|
||
type = 0,
|
||
userCount = 0,
|
||
tunnelProxy = "",
|
||
prixyIp = text
|
||
});
|
||
}
|
||
}
|
||
return list;
|
||
}
|
||
catch (Exception)
|
||
{
|
||
return list;
|
||
}
|
||
}
|
||
array = IpReust.Split('\n');
|
||
for (int i = 0; i < array.Length; i++)
|
||
{
|
||
string text3 = array[i].Replace("\r", "").Replace("\n", "");
|
||
if (!string.IsNullOrEmpty(authenUserInfo))
|
||
{
|
||
text3 = authenUserInfo + "@" + text3;
|
||
}
|
||
if (text3.Substring(text3.IndexOf('@') + 1).Split(':').Length == 2 && regex.IsMatch(text3.Substring(text3.IndexOf('@') + 1).Split(':')[0]))
|
||
{
|
||
list.Add(new ProxyIpModel
|
||
{
|
||
expirationTime = null,
|
||
type = 0,
|
||
userCount = 0,
|
||
tunnelProxy = "",
|
||
prixyIp = text3
|
||
});
|
||
}
|
||
}
|
||
return list;
|
||
}
|
||
|
||
private static void ApiJsonParameterPase(string suore, out string[] ipParameter, out string[] proParameter, out string[] expireTimeParameter)
|
||
{
|
||
ipParameter = new string[1] { "ip" };
|
||
proParameter = new string[1] { "port" };
|
||
expireTimeParameter = new string[1] { "expire_time" };
|
||
string[] array = suore.Split('|');
|
||
foreach (string text in array)
|
||
{
|
||
if (text.StartsWith("ip="))
|
||
{
|
||
ipParameter = text.Split('=')[1].Split(',').ToArray();
|
||
}
|
||
if (text.StartsWith("port="))
|
||
{
|
||
proParameter = text.Split('=')[1].Split(',').ToArray();
|
||
}
|
||
if (text.StartsWith("expireTime="))
|
||
{
|
||
expireTimeParameter = text.Split('=')[1].Split(',').ToArray();
|
||
}
|
||
}
|
||
}
|
||
|
||
private void button2_Click(object sender, EventArgs e)
|
||
{
|
||
if (!checkNetApi(txtNetWordApiURL.Text))
|
||
{
|
||
return;
|
||
}
|
||
HttpHelper httpHelper = new HttpHelper();
|
||
HttpItem httpItem = new HttpItem
|
||
{
|
||
URL = txtNetWordApiURL.Text,
|
||
Method = "GET",
|
||
Timeout = 20000,
|
||
ReadWriteTimeout = 20000,
|
||
UserAgent = "liuyeu_proxy_AppleBatch_June"
|
||
};
|
||
httpItem.Header.Add("liyueToken", ProxyRunService.getVerifyToken("checkNetApi"));
|
||
HttpResult html = httpHelper.GetHtml(httpItem);
|
||
insertLog(string.Concat("测试提取IP返回:", html.StatusCode, "\n", html.Html));
|
||
if (html.StatusCode != HttpStatusCode.OK)
|
||
{
|
||
return;
|
||
}
|
||
int num = 0;
|
||
string text = txtApiAccountName.Text;
|
||
string text2 = txtApiAccountPwd.Text;
|
||
string authenUserInfo = "";
|
||
if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(text2))
|
||
{
|
||
authenUserInfo = text + ":" + text2;
|
||
}
|
||
foreach (ProxyIpModel pitem in getIPListArray(html.Html, authenUserInfo))
|
||
{
|
||
if (num <= 5)
|
||
{
|
||
ProxyIpModel ipitem = pitem;
|
||
Task.Run(delegate
|
||
{
|
||
string uRL = "http://myip.top";
|
||
HttpItem item = new HttpItem
|
||
{
|
||
URL = uRL,
|
||
Method = "GET",
|
||
Timeout = 30000,
|
||
ReadWriteTimeout = 30000,
|
||
WebProxy = new WebProxy(ipitem.prixyIp.Replace("\r", ""))
|
||
};
|
||
HttpResult html2 = new HttpHelper().GetHtml(item);
|
||
insertLog(string.Concat("测试获取IP[", pitem.prixyIp.Replace("\r", ""), "]返回: ", html2.StatusCode, " \n", html2.Html));
|
||
});
|
||
}
|
||
num++;
|
||
}
|
||
}
|
||
|
||
private void addCkeckBox(string txt, int pi, bool ckSate, string id, int y)
|
||
{
|
||
if (ckSate)
|
||
{
|
||
RadioHttpAgentRouteLine = id;
|
||
}
|
||
RadioButton radioButton = new RadioButton();
|
||
radioButton.AutoSize = true;
|
||
radioButton.Font = new Font("微软雅黑", 10.5f, FontStyle.Regular, GraphicsUnit.Point, 134);
|
||
radioButton.Location = new Point(pi, y);
|
||
radioButton.Size = new Size(70, 24);
|
||
radioButton.TabIndex = 0;
|
||
radioButton.Checked = ckSate;
|
||
radioButton.Text = txt;
|
||
radioButton.Tag = id;
|
||
radioButton.UseVisualStyleBackColor = true;
|
||
radioButton.CheckedChanged += radioButton1_CheckedChanged;
|
||
pageDefault.Controls.Add(radioButton);
|
||
}
|
||
|
||
private void checkBox1_CheckedChanged(object sender, EventArgs e)
|
||
{
|
||
}
|
||
|
||
private void radioButton1_CheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (((RadioButton)sender).Checked)
|
||
{
|
||
RadioHttpAgentRouteLine = ((RadioButton)sender).Tag.ToString();
|
||
}
|
||
}
|
||
|
||
private void txtNowIp_TextChanged(object sender, EventArgs e)
|
||
{
|
||
}
|
||
|
||
private void txtThredSize_TextChanged(object sender, EventArgs e)
|
||
{
|
||
if (string.IsNullOrEmpty(txtThredSize.Text))
|
||
{
|
||
return;
|
||
}
|
||
if (comNetworkConfig.SelectedIndex != 1 && comNetworkConfig.SelectedIndex != 2)
|
||
{
|
||
if (comNetworkConfig.SelectedIndex != 0)
|
||
{
|
||
return;
|
||
}
|
||
string[] array = AppSysConfig.getConfig("SystemProxyThredSize").Split('-');
|
||
if (int.TryParse(array[0].Trim(), out var result) && int.TryParse(array[1].Trim(), out var result2) && int.TryParse(txtThredSize.Text, out var result3))
|
||
{
|
||
if (result3 < result)
|
||
{
|
||
txtThredSize.Text = result.ToString();
|
||
}
|
||
if (result3 > result2)
|
||
{
|
||
txtThredSize.Text = AppSysConfig.getConfig("ThredSizeDefault");
|
||
}
|
||
}
|
||
return;
|
||
}
|
||
string[] array2 = AppSysConfig.getConfig("OtherProxyThredSize").Split('-');
|
||
if (int.TryParse(array2[0].Trim(), out var result4) && int.TryParse(array2[1].Trim(), out var result5) && int.TryParse(txtThredSize.Text, out var result6))
|
||
{
|
||
if (result6 < result4)
|
||
{
|
||
txtThredSize.Text = result4.ToString();
|
||
}
|
||
if (result6 > result5)
|
||
{
|
||
txtThredSize.Text = result5.ToString();
|
||
}
|
||
}
|
||
}
|
||
|
||
private void radWebProtocolS2K_CheckedChanged(object sender, EventArgs e)
|
||
{
|
||
}
|
||
|
||
private void radWebProtocolOld_CheckedChanged(object sender, EventArgs e)
|
||
{
|
||
}
|
||
|
||
protected override void Dispose(bool disposing)
|
||
{
|
||
if (disposing && components != null)
|
||
{
|
||
components.Dispose();
|
||
}
|
||
base.Dispose(disposing);
|
||
}
|
||
|
||
private void InitializeComponent()
|
||
{
|
||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AppleBatch_June.FormNetwork));
|
||
this.label2 = new System.Windows.Forms.Label();
|
||
this.comNetworkConfig = new System.Windows.Forms.ComboBox();
|
||
this.btnSaveSetting = new System.Windows.Forms.Button();
|
||
this.btnClose = new System.Windows.Forms.Button();
|
||
this.tabConfig = new System.Windows.Forms.TabControl();
|
||
this.pageDefault = new System.Windows.Forms.TabPage();
|
||
this.label5 = new System.Windows.Forms.Label();
|
||
this.pageApi = new System.Windows.Forms.TabPage();
|
||
this.txtApiAccountPwd = new System.Windows.Forms.TextBox();
|
||
this.label4 = new System.Windows.Forms.Label();
|
||
this.txtApiAccountName = new System.Windows.Forms.TextBox();
|
||
this.label16 = new System.Windows.Forms.Label();
|
||
this.button2 = new System.Windows.Forms.Button();
|
||
this.label13 = new System.Windows.Forms.Label();
|
||
this.btnNetWorkApiTest = new System.Windows.Forms.Button();
|
||
this.txtNetWordApiURL = new System.Windows.Forms.TextBox();
|
||
this.label12 = new System.Windows.Forms.Label();
|
||
this.pageSuidao = new System.Windows.Forms.TabPage();
|
||
this.txtTpsPort = new System.Windows.Forms.TextBox();
|
||
this.label1 = new System.Windows.Forms.Label();
|
||
this.txtTpsPwd = new System.Windows.Forms.TextBox();
|
||
this.label9 = new System.Windows.Forms.Label();
|
||
this.btnTpsTest = new System.Windows.Forms.Button();
|
||
this.txtTpsUserName = new System.Windows.Forms.TextBox();
|
||
this.label10 = new System.Windows.Forms.Label();
|
||
this.txtTpsHost = new System.Windows.Forms.TextBox();
|
||
this.label11 = new System.Windows.Forms.Label();
|
||
this.pageBohao = new System.Windows.Forms.TabPage();
|
||
this.label3 = new System.Windows.Forms.Label();
|
||
this.button1 = new System.Windows.Forms.Button();
|
||
this.txtAdslIdCount = new System.Windows.Forms.TextBox();
|
||
this.label8 = new System.Windows.Forms.Label();
|
||
this.btnAdslTest = new System.Windows.Forms.Button();
|
||
this.txtAdslPwd = new System.Windows.Forms.TextBox();
|
||
this.label6 = new System.Windows.Forms.Label();
|
||
this.txtAdslUserName = new System.Windows.Forms.TextBox();
|
||
this.label7 = new System.Windows.Forms.Label();
|
||
this.label14 = new System.Windows.Forms.Label();
|
||
this.txtNowIp = new System.Windows.Forms.TextBox();
|
||
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
|
||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||
this.txtLog = new System.Windows.Forms.RichTextBox();
|
||
this.label50 = new System.Windows.Forms.Label();
|
||
this.labProxyThreadTip = new System.Windows.Forms.Label();
|
||
this.txtThredSize = new System.Windows.Forms.TextBox();
|
||
this.label15 = new System.Windows.Forms.Label();
|
||
this.panel1 = new System.Windows.Forms.Panel();
|
||
this.radWebProtocolDefault = new System.Windows.Forms.RadioButton();
|
||
this.radWebProtocolOld = new System.Windows.Forms.RadioButton();
|
||
this.radWebProtocolS2K = new System.Windows.Forms.RadioButton();
|
||
this.tabConfig.SuspendLayout();
|
||
this.pageDefault.SuspendLayout();
|
||
this.pageApi.SuspendLayout();
|
||
this.pageSuidao.SuspendLayout();
|
||
this.pageBohao.SuspendLayout();
|
||
this.groupBox3.SuspendLayout();
|
||
this.panel1.SuspendLayout();
|
||
base.SuspendLayout();
|
||
this.label2.AutoSize = true;
|
||
this.label2.Font = new System.Drawing.Font("微软雅黑", 9f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.label2.ForeColor = System.Drawing.Color.Red;
|
||
this.label2.Location = new System.Drawing.Point(9, 18);
|
||
this.label2.Name = "label2";
|
||
this.label2.Size = new System.Drawing.Size(80, 17);
|
||
this.label2.TabIndex = 1;
|
||
this.label2.Text = "选择代理类型";
|
||
this.comNetworkConfig.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||
this.comNetworkConfig.Font = new System.Drawing.Font("微软雅黑", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.comNetworkConfig.FormattingEnabled = true;
|
||
this.comNetworkConfig.Items.AddRange(new object[4] { "系统默认代理", "API代理提取", "隧道代理", "宽带拨号" });
|
||
this.comNetworkConfig.Location = new System.Drawing.Point(95, 13);
|
||
this.comNetworkConfig.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||
this.comNetworkConfig.Name = "comNetworkConfig";
|
||
this.comNetworkConfig.Size = new System.Drawing.Size(140, 25);
|
||
this.comNetworkConfig.TabIndex = 2;
|
||
this.comNetworkConfig.SelectedIndexChanged += new System.EventHandler(comNetworkConfig_SelectedIndexChanged);
|
||
this.btnSaveSetting.Font = new System.Drawing.Font("微软雅黑", 10.5f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.btnSaveSetting.ForeColor = System.Drawing.Color.Green;
|
||
this.btnSaveSetting.Location = new System.Drawing.Point(263, 363);
|
||
this.btnSaveSetting.Name = "btnSaveSetting";
|
||
this.btnSaveSetting.Size = new System.Drawing.Size(115, 35);
|
||
this.btnSaveSetting.TabIndex = 3;
|
||
this.btnSaveSetting.Text = "保存设置";
|
||
this.btnSaveSetting.UseVisualStyleBackColor = true;
|
||
this.btnSaveSetting.Click += new System.EventHandler(btnSaveSetting_Click);
|
||
this.btnClose.ForeColor = System.Drawing.Color.Red;
|
||
this.btnClose.Location = new System.Drawing.Point(83, 364);
|
||
this.btnClose.Name = "btnClose";
|
||
this.btnClose.Size = new System.Drawing.Size(106, 35);
|
||
this.btnClose.TabIndex = 4;
|
||
this.btnClose.Text = "关闭";
|
||
this.btnClose.UseVisualStyleBackColor = true;
|
||
this.btnClose.Click += new System.EventHandler(btnClose_Click);
|
||
this.tabConfig.Controls.Add(this.pageDefault);
|
||
this.tabConfig.Controls.Add(this.pageApi);
|
||
this.tabConfig.Controls.Add(this.pageSuidao);
|
||
this.tabConfig.Controls.Add(this.pageBohao);
|
||
this.tabConfig.Location = new System.Drawing.Point(30, 45);
|
||
this.tabConfig.Name = "tabConfig";
|
||
this.tabConfig.SelectedIndex = 0;
|
||
this.tabConfig.Size = new System.Drawing.Size(450, 205);
|
||
this.tabConfig.TabIndex = 5;
|
||
this.pageDefault.Controls.Add(this.label5);
|
||
this.pageDefault.Location = new System.Drawing.Point(4, 26);
|
||
this.pageDefault.Name = "pageDefault";
|
||
this.pageDefault.Size = new System.Drawing.Size(442, 175);
|
||
this.pageDefault.TabIndex = 3;
|
||
this.pageDefault.Text = "系统代理路线";
|
||
this.pageDefault.UseVisualStyleBackColor = true;
|
||
this.label5.AutoSize = true;
|
||
this.label5.Location = new System.Drawing.Point(17, 22);
|
||
this.label5.Name = "label5";
|
||
this.label5.Size = new System.Drawing.Size(199, 17);
|
||
this.label5.TabIndex = 3;
|
||
this.label5.Text = "请选择ip代理路线。默认选择第一个";
|
||
this.pageApi.Controls.Add(this.txtApiAccountPwd);
|
||
this.pageApi.Controls.Add(this.label4);
|
||
this.pageApi.Controls.Add(this.txtApiAccountName);
|
||
this.pageApi.Controls.Add(this.label16);
|
||
this.pageApi.Controls.Add(this.button2);
|
||
this.pageApi.Controls.Add(this.label13);
|
||
this.pageApi.Controls.Add(this.btnNetWorkApiTest);
|
||
this.pageApi.Controls.Add(this.txtNetWordApiURL);
|
||
this.pageApi.Controls.Add(this.label12);
|
||
this.pageApi.Location = new System.Drawing.Point(4, 26);
|
||
this.pageApi.Name = "pageApi";
|
||
this.pageApi.Padding = new System.Windows.Forms.Padding(3);
|
||
this.pageApi.Size = new System.Drawing.Size(442, 175);
|
||
this.pageApi.TabIndex = 0;
|
||
this.pageApi.Text = "API代理提取";
|
||
this.pageApi.UseVisualStyleBackColor = true;
|
||
this.txtApiAccountPwd.Location = new System.Drawing.Point(250, 67);
|
||
this.txtApiAccountPwd.Name = "txtApiAccountPwd";
|
||
this.txtApiAccountPwd.Size = new System.Drawing.Size(119, 23);
|
||
this.txtApiAccountPwd.TabIndex = 26;
|
||
this.label4.AutoSize = true;
|
||
this.label4.Location = new System.Drawing.Point(213, 72);
|
||
this.label4.Name = "label4";
|
||
this.label4.Size = new System.Drawing.Size(32, 17);
|
||
this.label4.TabIndex = 27;
|
||
this.label4.Text = "密码";
|
||
this.txtApiAccountName.Location = new System.Drawing.Point(90, 67);
|
||
this.txtApiAccountName.Name = "txtApiAccountName";
|
||
this.txtApiAccountName.Size = new System.Drawing.Size(111, 23);
|
||
this.txtApiAccountName.TabIndex = 25;
|
||
this.label16.AutoSize = true;
|
||
this.label16.Location = new System.Drawing.Point(15, 71);
|
||
this.label16.Name = "label16";
|
||
this.label16.Size = new System.Drawing.Size(68, 17);
|
||
this.label16.TabIndex = 24;
|
||
this.label16.Text = "认证用户名";
|
||
this.button2.Location = new System.Drawing.Point(148, 100);
|
||
this.button2.Name = "button2";
|
||
this.button2.Size = new System.Drawing.Size(119, 26);
|
||
this.button2.TabIndex = 23;
|
||
this.button2.Text = "提取并测试访问";
|
||
this.button2.UseVisualStyleBackColor = true;
|
||
this.button2.Click += new System.EventHandler(button2_Click);
|
||
this.label13.AutoSize = true;
|
||
this.label13.ForeColor = System.Drawing.Color.DarkRed;
|
||
this.label13.Location = new System.Drawing.Point(6, 133);
|
||
this.label13.Name = "label13";
|
||
this.label13.Size = new System.Drawing.Size(403, 34);
|
||
this.label13.TabIndex = 22;
|
||
this.label13.Text = "温馨提示:API选择 数据格式 选 【TXT】 分割符选 【回车换行(\\r\\n)】\r\n 单次提取IP,尽量设置1-5个IP,白名单认证不用填用户名和密码";
|
||
this.btnNetWorkApiTest.Location = new System.Drawing.Point(23, 100);
|
||
this.btnNetWorkApiTest.Name = "btnNetWorkApiTest";
|
||
this.btnNetWorkApiTest.Size = new System.Drawing.Size(92, 26);
|
||
this.btnNetWorkApiTest.TabIndex = 21;
|
||
this.btnNetWorkApiTest.Text = "提取测试";
|
||
this.btnNetWorkApiTest.UseVisualStyleBackColor = true;
|
||
this.btnNetWorkApiTest.Click += new System.EventHandler(btnNetWorkApiTest_Click);
|
||
this.txtNetWordApiURL.Location = new System.Drawing.Point(23, 33);
|
||
this.txtNetWordApiURL.Name = "txtNetWordApiURL";
|
||
this.txtNetWordApiURL.Size = new System.Drawing.Size(405, 23);
|
||
this.txtNetWordApiURL.TabIndex = 19;
|
||
this.label12.AutoSize = true;
|
||
this.label12.Location = new System.Drawing.Point(20, 13);
|
||
this.label12.Name = "label12";
|
||
this.label12.Size = new System.Drawing.Size(75, 17);
|
||
this.label12.TabIndex = 18;
|
||
this.label12.Text = "API提取地址";
|
||
this.pageSuidao.Controls.Add(this.txtTpsPort);
|
||
this.pageSuidao.Controls.Add(this.label1);
|
||
this.pageSuidao.Controls.Add(this.txtTpsPwd);
|
||
this.pageSuidao.Controls.Add(this.label9);
|
||
this.pageSuidao.Controls.Add(this.btnTpsTest);
|
||
this.pageSuidao.Controls.Add(this.txtTpsUserName);
|
||
this.pageSuidao.Controls.Add(this.label10);
|
||
this.pageSuidao.Controls.Add(this.txtTpsHost);
|
||
this.pageSuidao.Controls.Add(this.label11);
|
||
this.pageSuidao.Location = new System.Drawing.Point(4, 26);
|
||
this.pageSuidao.Name = "pageSuidao";
|
||
this.pageSuidao.Padding = new System.Windows.Forms.Padding(3);
|
||
this.pageSuidao.Size = new System.Drawing.Size(442, 175);
|
||
this.pageSuidao.TabIndex = 1;
|
||
this.pageSuidao.Text = "隧道代理";
|
||
this.pageSuidao.UseVisualStyleBackColor = true;
|
||
this.txtTpsPort.Location = new System.Drawing.Point(100, 52);
|
||
this.txtTpsPort.Name = "txtTpsPort";
|
||
this.txtTpsPort.Size = new System.Drawing.Size(101, 23);
|
||
this.txtTpsPort.TabIndex = 18;
|
||
this.label1.AutoSize = true;
|
||
this.label1.Location = new System.Drawing.Point(23, 55);
|
||
this.label1.Name = "label1";
|
||
this.label1.Size = new System.Drawing.Size(62, 17);
|
||
this.label1.TabIndex = 23;
|
||
this.label1.Text = "HTTP端口";
|
||
this.txtTpsPwd.Location = new System.Drawing.Point(312, 85);
|
||
this.txtTpsPwd.Name = "txtTpsPwd";
|
||
this.txtTpsPwd.Size = new System.Drawing.Size(119, 23);
|
||
this.txtTpsPwd.TabIndex = 20;
|
||
this.label9.AutoSize = true;
|
||
this.label9.Location = new System.Drawing.Point(275, 90);
|
||
this.label9.Name = "label9";
|
||
this.label9.Size = new System.Drawing.Size(32, 17);
|
||
this.label9.TabIndex = 21;
|
||
this.label9.Text = "密码";
|
||
this.btnTpsTest.Location = new System.Drawing.Point(100, 124);
|
||
this.btnTpsTest.Name = "btnTpsTest";
|
||
this.btnTpsTest.Size = new System.Drawing.Size(101, 26);
|
||
this.btnTpsTest.TabIndex = 20;
|
||
this.btnTpsTest.Text = "访问网页测试";
|
||
this.btnTpsTest.UseVisualStyleBackColor = true;
|
||
this.btnTpsTest.Click += new System.EventHandler(btnTpsTest_Click);
|
||
this.txtTpsUserName.Location = new System.Drawing.Point(100, 86);
|
||
this.txtTpsUserName.Name = "txtTpsUserName";
|
||
this.txtTpsUserName.Size = new System.Drawing.Size(169, 23);
|
||
this.txtTpsUserName.TabIndex = 19;
|
||
this.label10.AutoSize = true;
|
||
this.label10.Location = new System.Drawing.Point(17, 89);
|
||
this.label10.Name = "label10";
|
||
this.label10.Size = new System.Drawing.Size(68, 17);
|
||
this.label10.TabIndex = 18;
|
||
this.label10.Text = "隧道用户名";
|
||
this.txtTpsHost.Location = new System.Drawing.Point(100, 16);
|
||
this.txtTpsHost.Name = "txtTpsHost";
|
||
this.txtTpsHost.Size = new System.Drawing.Size(331, 23);
|
||
this.txtTpsHost.TabIndex = 17;
|
||
this.label11.AutoSize = true;
|
||
this.label11.Location = new System.Drawing.Point(6, 19);
|
||
this.label11.Name = "label11";
|
||
this.label11.Size = new System.Drawing.Size(91, 17);
|
||
this.label11.TabIndex = 16;
|
||
this.label11.Text = "隧道地址(Host)";
|
||
this.pageBohao.Controls.Add(this.label3);
|
||
this.pageBohao.Controls.Add(this.button1);
|
||
this.pageBohao.Controls.Add(this.txtAdslIdCount);
|
||
this.pageBohao.Controls.Add(this.label8);
|
||
this.pageBohao.Controls.Add(this.btnAdslTest);
|
||
this.pageBohao.Controls.Add(this.txtAdslPwd);
|
||
this.pageBohao.Controls.Add(this.label6);
|
||
this.pageBohao.Controls.Add(this.txtAdslUserName);
|
||
this.pageBohao.Controls.Add(this.label7);
|
||
this.pageBohao.Location = new System.Drawing.Point(4, 26);
|
||
this.pageBohao.Name = "pageBohao";
|
||
this.pageBohao.Size = new System.Drawing.Size(442, 175);
|
||
this.pageBohao.TabIndex = 2;
|
||
this.pageBohao.Text = "宽带拨号";
|
||
this.pageBohao.UseVisualStyleBackColor = true;
|
||
this.pageBohao.Click += new System.EventHandler(tabPage3_Click);
|
||
this.label3.AutoSize = true;
|
||
this.label3.ForeColor = System.Drawing.Color.DarkRed;
|
||
this.label3.Location = new System.Drawing.Point(31, 130);
|
||
this.label3.Name = "label3";
|
||
this.label3.Size = new System.Drawing.Size(223, 17);
|
||
this.label3.TabIndex = 23;
|
||
this.label3.Text = "使用宽带拨号最好选用Win7 64位的系统";
|
||
this.button1.Location = new System.Drawing.Point(274, 94);
|
||
this.button1.Name = "button1";
|
||
this.button1.Size = new System.Drawing.Size(132, 26);
|
||
this.button1.TabIndex = 16;
|
||
this.button1.Text = "访问网页测试";
|
||
this.button1.UseVisualStyleBackColor = true;
|
||
this.button1.Click += new System.EventHandler(button1_Click);
|
||
this.txtAdslIdCount.Location = new System.Drawing.Point(178, 98);
|
||
this.txtAdslIdCount.Name = "txtAdslIdCount";
|
||
this.txtAdslIdCount.Size = new System.Drawing.Size(45, 23);
|
||
this.txtAdslIdCount.TabIndex = 12;
|
||
this.txtAdslIdCount.Text = "10";
|
||
this.label8.AutoSize = true;
|
||
this.label8.Location = new System.Drawing.Point(31, 103);
|
||
this.label8.Name = "label8";
|
||
this.label8.Size = new System.Drawing.Size(141, 17);
|
||
this.label8.TabIndex = 14;
|
||
this.label8.Text = "执行多少个ID后重新拨号";
|
||
this.btnAdslTest.Location = new System.Drawing.Point(274, 57);
|
||
this.btnAdslTest.Name = "btnAdslTest";
|
||
this.btnAdslTest.Size = new System.Drawing.Size(76, 26);
|
||
this.btnAdslTest.TabIndex = 13;
|
||
this.btnAdslTest.Text = "测试拨号";
|
||
this.btnAdslTest.UseVisualStyleBackColor = true;
|
||
this.btnAdslTest.Click += new System.EventHandler(btnAdslTest_Click);
|
||
this.txtAdslPwd.Location = new System.Drawing.Point(115, 60);
|
||
this.txtAdslPwd.Name = "txtAdslPwd";
|
||
this.txtAdslPwd.Size = new System.Drawing.Size(146, 23);
|
||
this.txtAdslPwd.TabIndex = 11;
|
||
this.label6.AutoSize = true;
|
||
this.label6.Location = new System.Drawing.Point(47, 64);
|
||
this.label6.Name = "label6";
|
||
this.label6.Size = new System.Drawing.Size(56, 17);
|
||
this.label6.TabIndex = 11;
|
||
this.label6.Text = "宽带密码";
|
||
this.txtAdslUserName.Location = new System.Drawing.Point(114, 19);
|
||
this.txtAdslUserName.Name = "txtAdslUserName";
|
||
this.txtAdslUserName.Size = new System.Drawing.Size(146, 23);
|
||
this.txtAdslUserName.TabIndex = 10;
|
||
this.label7.AutoSize = true;
|
||
this.label7.Location = new System.Drawing.Point(46, 23);
|
||
this.label7.Name = "label7";
|
||
this.label7.Size = new System.Drawing.Size(56, 17);
|
||
this.label7.TabIndex = 9;
|
||
this.label7.Text = "宽带账号";
|
||
this.label14.AutoSize = true;
|
||
this.label14.Location = new System.Drawing.Point(260, 19);
|
||
this.label14.Name = "label14";
|
||
this.label14.Size = new System.Drawing.Size(55, 17);
|
||
this.label14.TabIndex = 6;
|
||
this.label14.Text = "当前IP:";
|
||
this.txtNowIp.Location = new System.Drawing.Point(308, 15);
|
||
this.txtNowIp.Name = "txtNowIp";
|
||
this.txtNowIp.ReadOnly = true;
|
||
this.txtNowIp.Size = new System.Drawing.Size(132, 23);
|
||
this.txtNowIp.TabIndex = 7;
|
||
this.txtNowIp.TextChanged += new System.EventHandler(txtNowIp_TextChanged);
|
||
this.linkLabel1.AutoSize = true;
|
||
this.linkLabel1.Location = new System.Drawing.Point(445, 18);
|
||
this.linkLabel1.Name = "linkLabel1";
|
||
this.linkLabel1.Size = new System.Drawing.Size(43, 17);
|
||
this.linkLabel1.TabIndex = 8;
|
||
this.linkLabel1.TabStop = true;
|
||
this.linkLabel1.Text = "复制IP";
|
||
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(linkLabel1_LinkClicked);
|
||
this.groupBox3.Controls.Add(this.txtLog);
|
||
this.groupBox3.Location = new System.Drawing.Point(12, 406);
|
||
this.groupBox3.Name = "groupBox3";
|
||
this.groupBox3.Size = new System.Drawing.Size(471, 218);
|
||
this.groupBox3.TabIndex = 10;
|
||
this.groupBox3.TabStop = false;
|
||
this.groupBox3.Text = "IP测试日志-----------勾选 使用随机IP代理 时才会使用配置的代理 ";
|
||
this.txtLog.Dock = System.Windows.Forms.DockStyle.Fill;
|
||
this.txtLog.ForeColor = System.Drawing.Color.LightSeaGreen;
|
||
this.txtLog.Location = new System.Drawing.Point(3, 19);
|
||
this.txtLog.Name = "txtLog";
|
||
this.txtLog.ReadOnly = true;
|
||
this.txtLog.Size = new System.Drawing.Size(465, 196);
|
||
this.txtLog.TabIndex = 0;
|
||
this.txtLog.Text = "";
|
||
this.label50.AutoSize = true;
|
||
this.label50.Location = new System.Drawing.Point(21, 265);
|
||
this.label50.Name = "label50";
|
||
this.label50.Size = new System.Drawing.Size(80, 17);
|
||
this.label50.TabIndex = 26;
|
||
this.label50.Text = "执行线程数量";
|
||
this.labProxyThreadTip.AutoSize = true;
|
||
this.labProxyThreadTip.Location = new System.Drawing.Point(175, 252);
|
||
this.labProxyThreadTip.Name = "labProxyThreadTip";
|
||
this.labProxyThreadTip.Size = new System.Drawing.Size(320, 51);
|
||
this.labProxyThreadTip.TabIndex = 28;
|
||
this.labProxyThreadTip.Text = "默认线程数量是【{default}】,调整的线程勾选代理才有效\r\n使用系统代理允许执行 【{sys}】个 线程,\r\n自定义IP代理时, 允许执行【{other}】个线程";
|
||
this.txtThredSize.Location = new System.Drawing.Point(108, 261);
|
||
this.txtThredSize.Name = "txtThredSize";
|
||
this.txtThredSize.Size = new System.Drawing.Size(61, 23);
|
||
this.txtThredSize.TabIndex = 29;
|
||
this.txtThredSize.Text = "4";
|
||
this.txtThredSize.TextChanged += new System.EventHandler(txtThredSize_TextChanged);
|
||
this.label15.AutoSize = true;
|
||
this.label15.Location = new System.Drawing.Point(6, 8);
|
||
this.label15.Name = "label15";
|
||
this.label15.Size = new System.Drawing.Size(126, 17);
|
||
this.label15.TabIndex = 30;
|
||
this.label15.Text = "Apple网站登录协议:";
|
||
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||
this.panel1.Controls.Add(this.radWebProtocolDefault);
|
||
this.panel1.Controls.Add(this.radWebProtocolOld);
|
||
this.panel1.Controls.Add(this.label15);
|
||
this.panel1.Controls.Add(this.radWebProtocolS2K);
|
||
this.panel1.ForeColor = System.Drawing.Color.DarkMagenta;
|
||
this.panel1.Location = new System.Drawing.Point(22, 314);
|
||
this.panel1.Name = "panel1";
|
||
this.panel1.Size = new System.Drawing.Size(452, 35);
|
||
this.panel1.TabIndex = 31;
|
||
this.radWebProtocolDefault.AutoSize = true;
|
||
this.radWebProtocolDefault.Checked = true;
|
||
this.radWebProtocolDefault.Location = new System.Drawing.Point(134, 6);
|
||
this.radWebProtocolDefault.Name = "radWebProtocolDefault";
|
||
this.radWebProtocolDefault.Size = new System.Drawing.Size(50, 21);
|
||
this.radWebProtocolDefault.TabIndex = 31;
|
||
this.radWebProtocolDefault.TabStop = true;
|
||
this.radWebProtocolDefault.Text = "默认";
|
||
this.radWebProtocolDefault.UseVisualStyleBackColor = true;
|
||
this.radWebProtocolOld.AutoSize = true;
|
||
this.radWebProtocolOld.Location = new System.Drawing.Point(336, 6);
|
||
this.radWebProtocolOld.Name = "radWebProtocolOld";
|
||
this.radWebProtocolOld.Size = new System.Drawing.Size(86, 21);
|
||
this.radWebProtocolOld.TabIndex = 1;
|
||
this.radWebProtocolOld.Text = "旧接口协议";
|
||
this.radWebProtocolOld.UseVisualStyleBackColor = true;
|
||
this.radWebProtocolOld.CheckedChanged += new System.EventHandler(radWebProtocolOld_CheckedChanged);
|
||
this.radWebProtocolS2K.AutoSize = true;
|
||
this.radWebProtocolS2K.Location = new System.Drawing.Point(216, 6);
|
||
this.radWebProtocolS2K.Name = "radWebProtocolS2K";
|
||
this.radWebProtocolS2K.Size = new System.Drawing.Size(106, 21);
|
||
this.radWebProtocolS2K.TabIndex = 0;
|
||
this.radWebProtocolS2K.Text = "新协议【s2k】";
|
||
this.radWebProtocolS2K.UseVisualStyleBackColor = true;
|
||
this.radWebProtocolS2K.CheckedChanged += new System.EventHandler(radWebProtocolS2K_CheckedChanged);
|
||
base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 17f);
|
||
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||
base.ClientSize = new System.Drawing.Size(495, 643);
|
||
base.Controls.Add(this.panel1);
|
||
base.Controls.Add(this.txtThredSize);
|
||
base.Controls.Add(this.labProxyThreadTip);
|
||
base.Controls.Add(this.label50);
|
||
base.Controls.Add(this.groupBox3);
|
||
base.Controls.Add(this.linkLabel1);
|
||
base.Controls.Add(this.txtNowIp);
|
||
base.Controls.Add(this.label14);
|
||
base.Controls.Add(this.tabConfig);
|
||
base.Controls.Add(this.btnClose);
|
||
base.Controls.Add(this.btnSaveSetting);
|
||
base.Controls.Add(this.comNetworkConfig);
|
||
base.Controls.Add(this.label2);
|
||
this.Font = new System.Drawing.Font("微软雅黑", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
|
||
base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
|
||
base.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||
base.MaximizeBox = false;
|
||
base.MinimizeBox = false;
|
||
base.Name = "FormNetwork";
|
||
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||
this.Text = "网络和线程设置";
|
||
base.Load += new System.EventHandler(FormNetwork_Load);
|
||
this.tabConfig.ResumeLayout(false);
|
||
this.pageDefault.ResumeLayout(false);
|
||
this.pageDefault.PerformLayout();
|
||
this.pageApi.ResumeLayout(false);
|
||
this.pageApi.PerformLayout();
|
||
this.pageSuidao.ResumeLayout(false);
|
||
this.pageSuidao.PerformLayout();
|
||
this.pageBohao.ResumeLayout(false);
|
||
this.pageBohao.PerformLayout();
|
||
this.groupBox3.ResumeLayout(false);
|
||
this.panel1.ResumeLayout(false);
|
||
this.panel1.PerformLayout();
|
||
base.ResumeLayout(false);
|
||
base.PerformLayout();
|
||
}
|
||
}
|
||
}
|