Form1.cs
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Net;
using System.Diagnostics;
//www.51aspx.com
namespace PressureTest
{
public partial class Form1 : Form
{
private long _totalTimeCost = 0;
private int _endedConnenctionCount = 0;
private int _failedConnectionCount = 0;
private int _connectionCount = 0;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
button1.Enabled = false;
var url = this.textBox1.Text;
if (string.IsNullOrEmpty(url))
{
MessageBox.Show("URL不能为空!");
return;
}
int connectionCount = 0;
if (!int.TryParse(this.textBox2.Text, out connectionCount))
{
MessageBox.Show("Connection Count不合法!");
return;
}
myProcessBar1.Task = this.ProgressTask;
myProcessBar1.Run();
this._connectionCount = connectionCount;
label3.Text = " Please Wait...";
Thread requestThread = new Thread(() => StartRequest(url, connectionCount));
requestThread.IsBackground = true;
requestThread.Start();
}
private void StartRequest(string url,int connectionCount)
{
//ThreadPool.SetMaxThreads(connectionCount * 2, 0);
//Thread[] threads = new Thread[connectionCount];
for (int i = 0; i < connectionCount; i++)
{
var request = HttpWebRequest.Create(url) as HttpWebRequest;
request.ContentType = "application/x-www-form-urlencoded";
后面还有 117 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。