FORM1.CS using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.IO;using System.Threading;namespace WindowsApplication3...{ public partial class Form1 : Form ...{ public Form1() ...{ InitializeComponent(); } private string path = ""; private void button1_Click(object sender, EventArgs e) ...{ this.openFileDialog1 = new OpenFileDialog(); openFileDialog1.Title = "打开代理文件"; openFileDialog1.CheckFileExists = true; openFileDialog1.CheckPathExists = true; openFileDialog1.AddExtension = true; openFileDialog1.Multiselect = false; openFileDialog1.Filter = "*.txt|*.txt|*.*|*.*"; if (openFileDialog1.ShowDialog() == DialogResult.OK) ...{ path = openFileDialog1.FileName; Thread cool = new Thread(new ThreadStart(bihande)); cool.Start(); /**/////FileInfo f = new FileInfo(openFileDialog1.FileName); ////StreamReader ce = f.OpenText(); ////this.richTextBox1.Text = ce.ReadToEnd(); ////ce.Close(); //////for (int i = 0; i < richTextBox1.Lines.Length; i++) //////{ ////// Thread.Sleep(2); ////// this.listBox1.Items.Add(richTextBox1.Lines[i]); //////} } } private void bihande() ...{ FileInfo f = new FileInfo(openFileDialog1.FileName); FileStream a = f.OpenRead(); byte[] buff=new byte[1024]; while (a.Read(buff, 0, buff.Length) > 0) ...{ string nn = Encoding.Default.GetString(buff); this.richTextBox1.BeginInvoke(new System.EventHandler(UpdateUI), nn); } a.Close(); } private void prog(object o, System.EventArgs e) ...{ this.progressBar1.Value = (int)o; } private void labelx(object o, System.EventArgs e) ...{ this.label2.Text = o.ToString(); } private void UpdateUI(object o, System.EventArgs e) ...{ this.richTextBox1.AppendText(o.ToString()); } private void UpdateUI2(object o, System.EventArgs e) ...{ this.richTextBox1.Text=o.ToString(); } private string getff(string k) ...{ try ...{ int i = k.IndexOf(' '); k = k.Remove(0, i + 1); i = k.IndexOf(" H"); k = k.Remove(i, k.Length - i); return k; } catch ...{ return "aaa"; } //try //{ // int i1 = 0; // int i2 = 0; // int i3 = 0; // for (int i = 0; i < k.Length; i++) // { // if (k[i] ==' ') // { // i1 = i; // } // } // MessageBox.Show(k.Length.ToString()); // string of = k.Remove(0, i1 + 1); // int b = 0; // for (int i = 0; i < of.Length; i++) // { // if (k[i] == ' ') // { // if (b == 0) // { // b++; // } // else if (b == 1) // { // i3 = i; // } // } // } // return of.Remove(i3, k.Length - i3); //} //catch //{ // return "aaa "; //} } private string getffx(string k) ...{ int i = k.IndexOf(' '); return k.Remove(i, k.Length - i); } string khhh = ""; string zeno = ""; // int full = 0; int abuse = 0; private void button3_Click(object sender, EventArgs e) ...{ this.saveFileDialog1 = new SaveFileDialog(); saveFileDialog1.Title = "保存代理文件"; saveFileDialog1.OverwritePrompt = true; saveFileDialog1.CreatePrompt = true; saveFileDialog1.AddExtension = true; saveFileDialog1.Filter = "*.txt|*.txt|*.*|*.*"; if (saveFileDialog1.ShowDialog() == DialogResult.OK) ...{ khhh = saveFileDialog1.FileName; zeno = this.textBox2.Text; this.label1.Text = this.richTextBox1.Lines.Length.ToString(); this.progressBar1.Maximum = this.richTextBox1.Lines.Length; Thread no = new Thread(new ThreadStart(kull)); no.Start(); abuse = int.Parse(this.textBox1.Text); // kull(); } } private void kull() ...{ FileStream jj = new FileStream(khhh, FileMode.OpenOrCreate, FileAccess.ReadWrite); for (int i = 0; i < this.richTextBox1.Lines.Length; i++) ...{ byte[] nnnc = Encoding.Default.GetBytes(gaila(this.richTextBox1.Lines[i].ToString())+" "); jj.Write(nnnc, 0, nnnc.Length); this.progressBar1.BeginInvoke(new System.EventHandler(prog),i); this.label2.BeginInvoke(new System.EventHandler(labelx), i); } jj.Close(); MessageBox.Show("完成"); } private string gaila(string a) ...{ int kafu = a.Length; if (kafu > 2) ...{ if (a.IndexOf('/') > 0) ...{ if (a[kafu - abuse] == '0') ...{ if (a.IndexOf('-') < 0) ...{ return a.Remove(kafu - abuse, abuse); } else ...{ return a+zeno; } } else ...{ return a; } } else ...{ return a; } } else ...{ Thread.Sleep(10); return a; } } private void button2_Click(object sender, EventArgs e) ...{ } //private void button2_Click(object sender, EventArgs e) //{ // this.saveFileDialog1 = new SaveFileDialog(); // saveFileDialog1.Title = "保存代理文件"; // saveFileDialog1.OverwritePrompt = true; // saveFileDialog1.CreatePrompt = true; // saveFileDialog1.AddExtension = true; // saveFileDialog1.Filter = "*.txt|*.txt|*.*|*.*"; // if (saveFileDialog1.ShowDialog() == DialogResult.OK) // { // this.richTextBox1.Text = ""; // for (int i = 0; i < this.listBox1.Items.Count; i++) // { // this.richTextBox1.AppendText(this.listBox1.Items[i].ToString() + " "); // } // StreamWriter nn = new StreamWriter(saveFileDialog1.FileName); // nn.Write(this.richTextBox1.Text); // nn.Close(); // } // } }} Form1.Designer.cs namespace WindowsApplication3...{ partial class Form1 ...{ /**//// <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); } Windows 窗体设计器生成的代码#region Windows 窗体设计器生成的代码 /**//// <summary> /// 设计器支持所需的方法 - 不要 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() ...{ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this.button1 = new System.Windows.Forms.Button(); this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.button3 = new System.Windows.Forms.Button(); this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.progressBar1 = new System.Windows.Forms.ProgressBar(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.textBox1 = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.textBox2 = new System.Windows.Forms.TextBox(); this.SuspendLayout(); // // button1 // this.button1.Location = new System.Drawing.Point(12, 12); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(75, 23); this.button1.TabIndex = 0; this.button1.Text = "打开"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // richTextBox1 // this.richTextBox1.Location = new System.Drawing.Point(18, 52); this.richTextBox1.Name = "richTextBox1"; this.richTextBox1.Size = new System.Drawing.Size(407, 148); this.richTextBox1.TabIndex = 2; this.richTextBox1.Text = ""; // // button3 // this.button3.Location = new System.Drawing.Point(333, 12); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(75, 23); this.button3.TabIndex = 3; this.button3.Text = "处理并保存"; this.button3.UseVisualStyleBackColor = true; this.button3.Click += new System.EventHandler(this.button3_Click); // // openFileDialog1 // this.openFileDialog1.FileName = "openFileDialog1"; // // progressBar1 // this.progressBar1.Location = new System.Drawing.Point(18, 214); this.progressBar1.Name = "progressBar1"; this.progressBar1.Size = new System.Drawing.Size(407, 12); this.progressBar1.TabIndex = 4; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(381, 237); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(11, 12); this.label1.TabIndex = 5; this.label1.Text = "0"; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(39, 237); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(11, 12); this.label2.TabIndex = 6; this.label2.Text = "0"; // // textBox1 // this.textBox1.Location = new System.Drawing.Point(153, 15); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(17, 21); this.textBox1.TabIndex = 7; this.textBox1.Text = "1"; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(124, 18); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(23, 12); this.label3.TabIndex = 8; this.label3.Text = "去0"; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(207, 19); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(41, 12); this.label4.TabIndex = 9; this.label4.Text = "钱加?0"; // // textBox2 // this.textBox2.Location = new System.Drawing.Point(254, 15); this.textBox2.Name = "textBox2"; this.textBox2.Size = new System.Drawing.Size(34, 21); this.textBox2.TabIndex = 10; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(438, 258); this.Controls.Add(this.textBox2); this.Controls.Add(this.label4); this.Controls.Add(this.label3); this.Controls.Add(this.textBox1); this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Controls.Add(this.progressBar1); this.Controls.Add(this.button3); this.Controls.Add(this.richTextBox1); this.Controls.Add(this.button1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "Form1"; this.Text = "www.luyikk.com 暴率去0 工具"; this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Button button1; private System.Windows.Forms.RichTextBox richTextBox1; private System.Windows.Forms.Button button3; private System.Windows.Forms.SaveFileDialog saveFileDialog1; private System.Windows.Forms.OpenFileDialog openFileDialog1; private System.Windows.Forms.ProgressBar progressBar1; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label4; private System.Windows.Forms.TextBox textBox2; }}