首页 > 代码库 > popStar机机对战数据生成器代码(C#)

popStar机机对战数据生成器代码(C#)

代码:

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;using System.IO;namespace game1{    public partial class Form1 : Form    {        static Color[] coo=new Color[105];        static int colorKind;        public Form1()        {            InitializeComponent();        }        private void Form1_Load(object sender, EventArgs e)        {            foreach (Control i in this.Controls)            {                string x = i.Text.Substring(0,6);                if (x == "button")                {                    int t = Convert.ToInt32(i.Text.Substring(6, i.Text.Length - 6));                    int xx = t / 10 + 1;                    int yy = t % 10; if (yy == 0) { --xx; yy = 10; }                    i.Text = xx.ToString()+","+yy.ToString();                    i.BackColor = Color.White;                }            }            radioButton1.BackColor = Color.Red; radioButton1.Text = "          ";            radioButton2.BackColor = Color.Gold; radioButton2.Text = "          ";            radioButton3.BackColor = Color.SkyBlue; radioButton3.Text = "          ";            radioButton4.BackColor = Color.SpringGreen; radioButton4.Text = "          ";            radioButton5.BackColor = Color.Orchid; radioButton5.Text = "          ";            radioButton6.BackColor = Color.White; radioButton6.Text = "          ";            for (int i = 1; i <= 100; ++i) coo[i] = Color.White;        }        private void button1_Click(object sender, EventArgs e)        {            if (button1.BackColor == Color.Silver)                button1.BackColor = coo[1];            else            {                coo[1] = button1.BackColor;                button1.BackColor = Color.Silver;            }        }        private void button2_Click(object sender, EventArgs e)        {            if (button2.BackColor == Color.Silver)                button2.BackColor = coo[2];            else            {                coo[2] = button2.BackColor;                button2.BackColor = Color.Silver;            }        }        private void button3_Click(object sender, EventArgs e)        {            if (button3.BackColor == Color.Silver)                button3.BackColor = coo[3];            else            {                coo[3] = button3.BackColor;                button3.BackColor = Color.Silver;            }        }        private void button4_Click(object sender, EventArgs e)        {            if (button4.BackColor == Color.Silver)                button4.BackColor = coo[4];            else            {                coo[4] = button4.BackColor;                button4.BackColor = Color.Silver;            }        }        private void button5_Click(object sender, EventArgs e)        {            if (button5.BackColor == Color.Silver)                button5.BackColor = coo[5];            else            {                coo[5] = button5.BackColor;                button5.BackColor = Color.Silver;            }        }        private void button6_Click(object sender, EventArgs e)        {            if (button6.BackColor == Color.Silver)                button6.BackColor = coo[6];            else            {                coo[6] = button6.BackColor;                button6.BackColor = Color.Silver;            }        }        private void button7_Click(object sender, EventArgs e)        {            if (button7.BackColor == Color.Silver)                button7.BackColor = coo[7];            else            {                coo[7] = button7.BackColor;                button7.BackColor = Color.Silver;            }        }        private void button8_Click(object sender, EventArgs e)        {            if (button8.BackColor == Color.Silver)                button8.BackColor = coo[8];            else            {                coo[8] = button8.BackColor;                button8.BackColor = Color.Silver;            }        }        private void button9_Click(object sender, EventArgs e)        {            if (button9.BackColor == Color.Silver)                button9.BackColor = coo[9];            else            {                coo[9] = button9.BackColor;                button9.BackColor = Color.Silver;            }        }        private void button10_Click(object sender, EventArgs e)        {            if (button10.BackColor == Color.Silver)                button10.BackColor = coo[10];            else            {                coo[10] = button10.BackColor;                button10.BackColor = Color.Silver;            }        }        private void button11_Click(object sender, EventArgs e)        {            if (button11.BackColor == Color.Silver)                button11.BackColor = coo[11];            else            {                coo[11] = button11.BackColor;                button11.BackColor = Color.Silver;            }        }        private void button12_Click(object sender, EventArgs e)        {            if (button12.BackColor == Color.Silver)                button12.BackColor = coo[12];            else            {                coo[12] = button12.BackColor;                button12.BackColor = Color.Silver;            }        }        private void button13_Click(object sender, EventArgs e)        {            if (button13.BackColor == Color.Silver)                button13.BackColor = coo[13];            else            {                coo[13] = button13.BackColor;                button13.BackColor = Color.Silver;            }        }        private void button14_Click(object sender, EventArgs e)        {            if (button14.BackColor == Color.Silver)                button14.BackColor = coo[14];            else            {                coo[14] = button14.BackColor;                button14.BackColor = Color.Silver;            }        }        private void button15_Click(object sender, EventArgs e)        {            if (button15.BackColor == Color.Silver)                button15.BackColor = coo[15];            else            {                coo[15] = button15.BackColor;                button15.BackColor = Color.Silver;            }        }        private void button16_Click(object sender, EventArgs e)        {            if (button16.BackColor == Color.Silver)                button16.BackColor = coo[16];            else            {                coo[16] = button16.BackColor;                button16.BackColor = Color.Silver;            }        }        private void button17_Click(object sender, EventArgs e)        {            if (button17.BackColor == Color.Silver)                button17.BackColor = coo[17];            else            {                coo[17] = button17.BackColor;                button17.BackColor = Color.Silver;            }        }        private void button18_Click(object sender, EventArgs e)        {            if (button18.BackColor == Color.Silver)                button18.BackColor = coo[18];            else            {                coo[18] = button18.BackColor;                button18.BackColor = Color.Silver;            }        }        private void button19_Click(object sender, EventArgs e)        {            if (button19.BackColor == Color.Silver)                button19.BackColor = coo[19];            else            {                coo[ 19] = button19.BackColor;                button19.BackColor = Color.Silver;            }        }        private void button20_Click(object sender, EventArgs e)        {            if (button20.BackColor == Color.Silver)                button20.BackColor = coo[20];            else            {                coo[20] = button20.BackColor;                button20.BackColor = Color.Silver;            }        }        private void button21_Click(object sender, EventArgs e)        {            if (button21.BackColor == Color.Silver)                button21.BackColor = coo[21];            else            {                coo[21] = button21.BackColor;                button21.BackColor = Color.Silver;            }        }        private void button22_Click(object sender, EventArgs e)        {            if (button22.BackColor == Color.Silver)                button22.BackColor = coo[22];            else            {                coo[22] = button22.BackColor;                button22.BackColor = Color.Silver;            }        }        private void button23_Click(object sender, EventArgs e)        {            if (button23.BackColor == Color.Silver)                button23.BackColor = coo[23];            else            {                coo[23] = button23.BackColor;                button23.BackColor = Color.Silver;            }        }        private void button24_Click(object sender, EventArgs e)        {            if (button24.BackColor == Color.Silver)                button24.BackColor = coo[24];            else            {                coo[24] = button24.BackColor;                button24.BackColor = Color.Silver;            }        }        private void button25_Click(object sender, EventArgs e)        {            if (button25.BackColor == Color.Silver)                button25.BackColor = coo[5];            else            {                coo[25] = button25.BackColor;                button25.BackColor = Color.Silver;            }        }        private void button26_Click(object sender, EventArgs e)        {            if (button26.BackColor == Color.Silver)                button26.BackColor = coo[26];            else            {                coo[26] = button26.BackColor;                button26.BackColor = Color.Silver;            }        }        private void button27_Click(object sender, EventArgs e)        {            if (button27.BackColor == Color.Silver)                button27.BackColor = coo[27];            else            {                coo[27] = button27.BackColor;                button27.BackColor = Color.Silver;            }        }        private void button28_Click(object sender, EventArgs e)        {            if (button28.BackColor == Color.Silver)                button28.BackColor = coo[28];            else            {                coo[28] = button28.BackColor;                button28.BackColor = Color.Silver;            }        }        private void button29_Click(object sender, EventArgs e)        {            if (button29.BackColor == Color.Silver)                button29.BackColor = coo[29];            else            {                coo[29] = button29.BackColor;                button29.BackColor = Color.Silver;            }        }        private void button30_Click(object sender, EventArgs e)        {            if (button30.BackColor == Color.Silver)                button30.BackColor = coo[30];            else            {                coo[30] = button30.BackColor;                button30.BackColor = Color.Silver;            }        }        private void button31_Click(object sender, EventArgs e)        {            if (button31.BackColor == Color.Silver)                button31.BackColor = coo[31];            else            {                coo[31] = button31.BackColor;                button31.BackColor = Color.Silver;            }        }        private void button32_Click(object sender, EventArgs e)        {            if (button32.BackColor == Color.Silver)                button32.BackColor = coo[32];            else            {                coo[32] = button32.BackColor;                button32.BackColor = Color.Silver;            }        }        private void button33_Click(object sender, EventArgs e)        {            if (button33.BackColor == Color.Silver)                button33.BackColor = coo[33];            else            {                coo[33] = button33.BackColor;                button33.BackColor = Color.Silver;            }        }        private void button34_Click(object sender, EventArgs e)        {            if (button34.BackColor == Color.Silver)                button34.BackColor = coo[34];            else            {                coo[34] = button34.BackColor;                button34.BackColor = Color.Silver;            }        }        private void button35_Click(object sender, EventArgs e)        {            if (button35.BackColor == Color.Silver)                button35.BackColor = coo[35];            else            {                coo[35] = button35.BackColor;                button35.BackColor = Color.Silver;            }        }        private void button36_Click(object sender, EventArgs e)        {            if (button36.BackColor == Color.Silver)                button36.BackColor = coo[36];            else            {                coo[36] = button36.BackColor;                button36.BackColor = Color.Silver;            }        }        private void button37_Click(object sender, EventArgs e)        {            if (button37.BackColor == Color.Silver)                button37.BackColor = coo[37];            else            {                coo[37] = button37.BackColor;                button37.BackColor = Color.Silver;            }        }        private void button38_Click(object sender, EventArgs e)        {            if (button38.BackColor == Color.Silver)                button38.BackColor = coo[38];            else            {                coo[38] = button38.BackColor;                button38.BackColor = Color.Silver;            }        }        private void button39_Click(object sender, EventArgs e)        {            if (button39.BackColor == Color.Silver)                button39.BackColor = coo[39];            else            {                coo[39] = button39.BackColor;                button39.BackColor = Color.Silver;            }        }        private void button40_Click(object sender, EventArgs e)        {            if (button40.BackColor == Color.Silver)                button40.BackColor = coo[40];            else            {                coo[40] = button40.BackColor;                button40.BackColor = Color.Silver;            }        }        private void button41_Click(object sender, EventArgs e)        {            if (button41.BackColor == Color.Silver)                button41.BackColor = coo[41];            else            {                coo[41] = button41.BackColor;                button41.BackColor = Color.Silver;            }        }        private void button42_Click(object sender, EventArgs e)        {            if (button42.BackColor == Color.Silver)                button42.BackColor = coo[42];            else            {                coo[42] = button42.BackColor;                button42.BackColor = Color.Silver;            }        }        private void button43_Click(object sender, EventArgs e)        {            if (button43.BackColor == Color.Silver)                button43.BackColor = coo[43];            else            {                coo[43] = button43.BackColor;                button43.BackColor = Color.Silver;            }        }        private void button44_Click(object sender, EventArgs e)        {            if (button44.BackColor == Color.Silver)                button44.BackColor = coo[44];            else            {                coo[44] = button44.BackColor;                button44.BackColor = Color.Silver;            }        }        private void button45_Click(object sender, EventArgs e)        {            if (button45.BackColor == Color.Silver)                button45.BackColor = coo[45];            else            {                coo[45] = button45.BackColor;                button45.BackColor = Color.Silver;            }        }        private void button46_Click(object sender, EventArgs e)        {            if (button46.BackColor == Color.Silver)                button46.BackColor = coo[46];            else            {                coo[46] = button46.BackColor;                button46.BackColor = Color.Silver;            }        }        private void button47_Click(object sender, EventArgs e)        {            if (button47.BackColor == Color.Silver)                button47.BackColor = coo[47];            else            {                coo[47] = button47.BackColor;                button47.BackColor = Color.Silver;            }        }        private void button48_Click(object sender, EventArgs e)        {            if (button48.BackColor == Color.Silver)                button48.BackColor = coo[48];            else            {                coo[48] = button48.BackColor;                button48.BackColor = Color.Silver;            }        }        private void button49_Click(object sender, EventArgs e)        {            if (button49.BackColor == Color.Silver)                button49.BackColor = coo[49];            else            {                coo[49] = button49.BackColor;                button49.BackColor = Color.Silver;            }        }        private void button50_Click(object sender, EventArgs e)        {            if (button50.BackColor == Color.Silver)                button50.BackColor = coo[50];            else            {                coo[50] = button50.BackColor;                button50.BackColor = Color.Silver;            }        }        private void button51_Click(object sender, EventArgs e)        {            if (button51.BackColor == Color.Silver)                button51.BackColor = coo[51];            else            {                coo[51] = button51.BackColor;                button51.BackColor = Color.Silver;            }        }        private void button52_Click(object sender, EventArgs e)        {            if (button52.BackColor == Color.Silver)                button52.BackColor = coo[52];            else            {                coo[52] = button52.BackColor;                button52.BackColor = Color.Silver;            }        }        private void button53_Click(object sender, EventArgs e)        {            if (button53.BackColor == Color.Silver)                button53.BackColor = coo[53];            else            {                coo[53] = button53.BackColor;                button53.BackColor = Color.Silver;            }        }        private void button54_Click(object sender, EventArgs e)        {            if (button54.BackColor == Color.Silver)                button54.BackColor = coo[54];            else            {                coo[54] = button54.BackColor;                button54.BackColor = Color.Silver;            }        }        private void button55_Click(object sender, EventArgs e)        {            if (button55.BackColor == Color.Silver)                button55.BackColor = coo[55];            else            {                coo[55] = button55.BackColor;                button55.BackColor = Color.Silver;            }        }        private void button56_Click(object sender, EventArgs e)        {            if (button56.BackColor == Color.Silver)                button56.BackColor = coo[56];            else            {                coo[56] = button56.BackColor;                button56.BackColor = Color.Silver;            }        }        private void button57_Click(object sender, EventArgs e)        {            if (button57.BackColor == Color.Silver)                button57.BackColor = coo[57];            else            {                coo[57] = button57.BackColor;                button57.BackColor = Color.Silver;            }        }        private void button58_Click(object sender, EventArgs e)        {            if (button58.BackColor == Color.Silver)                button58.BackColor = coo[58];            else            {                coo[58] = button58.BackColor;                button58.BackColor = Color.Silver;            }        }        private void button59_Click(object sender, EventArgs e)        {            if (button59.BackColor == Color.Silver)                button59.BackColor = coo[59];            else            {                coo[59] = button59.BackColor;                button59.BackColor = Color.Silver;            }        }        private void button60_Click(object sender, EventArgs e)        {            if (button60.BackColor == Color.Silver)                button60.BackColor = coo[60];            else            {                coo[60] = button60.BackColor;                button60.BackColor = Color.Silver;            }        }        private void button61_Click(object sender, EventArgs e)        {            if (button61.BackColor == Color.Silver)                button61.BackColor = coo[61];            else            {                coo[61] = button61.BackColor;                button61.BackColor = Color.Silver;            }        }        private void button62_Click(object sender, EventArgs e)        {            if (button62.BackColor == Color.Silver)                button62.BackColor = coo[62];            else            {                coo[62] = button62.BackColor;                button62.BackColor = Color.Silver;            }        }        private void button63_Click(object sender, EventArgs e)        {            if (button63.BackColor == Color.Silver)                button63.BackColor = coo[63];            else            {                coo[63] = button63.BackColor;                button63.BackColor = Color.Silver;            }        }        private void button64_Click(object sender, EventArgs e)        {            if (button64.BackColor == Color.Silver)                button64.BackColor = coo[64];            else            {                coo[64] = button64.BackColor;                button64.BackColor = Color.Silver;            }        }        private void button65_Click(object sender, EventArgs e)        {            if (button65.BackColor == Color.Silver)                button65.BackColor = coo[65];            else            {                coo[65] = button65.BackColor;                button65.BackColor = Color.Silver;            }        }        private void button66_Click(object sender, EventArgs e)        {            if (button66.BackColor == Color.Silver)                button66.BackColor = coo[66];            else            {                coo[66] = button66.BackColor;                button66.BackColor = Color.Silver;            }        }        private void button67_Click(object sender, EventArgs e)        {            if (button67.BackColor == Color.Silver)                button67.BackColor = coo[67];            else            {                coo[67] = button67.BackColor;                button67.BackColor = Color.Silver;            }        }        private void button68_Click(object sender, EventArgs e)        {            if (button68.BackColor == Color.Silver)                button68.BackColor = coo[68];            else            {                coo[68] = button68.BackColor;                button68.BackColor = Color.Silver;            }        }        private void button69_Click(object sender, EventArgs e)        {            if (button69.BackColor == Color.Silver)                button69.BackColor = coo[69];            else            {                coo[69] = button69.BackColor;                button69.BackColor = Color.Silver;            }        }        private void button70_Click(object sender, EventArgs e)        {            if (button70.BackColor == Color.Silver)                button70.BackColor = coo[70];            else            {                coo[70] = button70.BackColor;                button70.BackColor = Color.Silver;            }        }        private void button71_Click(object sender, EventArgs e)        {            if (button71.BackColor == Color.Silver)                button71.BackColor = coo[71];            else            {                coo[71] = button71.BackColor;                button71.BackColor = Color.Silver;            }        }        private void button72_Click(object sender, EventArgs e)        {            if (button72.BackColor == Color.Silver)                button72.BackColor = coo[72];            else            {                coo[72] = button72.BackColor;                button72.BackColor = Color.Silver;            }        }        private void button73_Click(object sender, EventArgs e)        {            if (button73.BackColor == Color.Silver)                button73.BackColor = coo[73];            else            {                coo[73] = button73.BackColor;                button73.BackColor = Color.Silver;            }        }        private void button74_Click(object sender, EventArgs e)        {            if (button74.BackColor == Color.Silver)                button74.BackColor = coo[74];            else            {                coo[74] = button74.BackColor;                button74.BackColor = Color.Silver;            }        }        private void button75_Click(object sender, EventArgs e)        {            if (button75.BackColor == Color.Silver)                button75.BackColor = coo[75];            else            {                coo[75] = button75.BackColor;                button75.BackColor = Color.Silver;            }        }        private void button76_Click(object sender, EventArgs e)        {            if (button76.BackColor == Color.Silver)                button76.BackColor = coo[76];            else            {                coo[76] = button76.BackColor;                button76.BackColor = Color.Silver;            }        }        private void button77_Click(object sender, EventArgs e)        {            if (button77.BackColor == Color.Silver)                button77.BackColor = coo[77];            else            {                coo[77] = button77.BackColor;                button77.BackColor = Color.Silver;            }        }        private void button78_Click(object sender, EventArgs e)        {            if (button78.BackColor == Color.Silver)                button78.BackColor = coo[78];            else            {                coo[78] = button78.BackColor;                button78.BackColor = Color.Silver;            }        }        private void button79_Click(object sender, EventArgs e)        {            if (button79.BackColor == Color.Silver)                button79.BackColor = coo[79];            else            {                coo[79] = button79.BackColor;                button79.BackColor = Color.Silver;            }        }        private void button80_Click(object sender, EventArgs e)        {            if (button80.BackColor == Color.Silver)                button80.BackColor = coo[80];            else            {                coo[80] = button80.BackColor;                button80.BackColor = Color.Silver;            }        }        private void button81_Click(object sender, EventArgs e)        {            if (button81.BackColor == Color.Silver)                button81.BackColor = coo[81];            else            {                coo[81] = button81.BackColor;                button81.BackColor = Color.Silver;            }        }        private void button82_Click(object sender, EventArgs e)        {            if (button82.BackColor == Color.Silver)                button82.BackColor = coo[82];            else            {                coo[82] = button82.BackColor;                button82.BackColor = Color.Silver;            }        }        private void button83_Click(object sender, EventArgs e)        {            if (button83.BackColor == Color.Silver)                button83.BackColor = coo[83];            else            {                coo[83] = button83.BackColor;                button83.BackColor = Color.Silver;            }        }        private void button84_Click(object sender, EventArgs e)        {            if (button84.BackColor == Color.Silver)                button84.BackColor = coo[84];            else            {                coo[84] = button84.BackColor;                button84.BackColor = Color.Silver;            }        }        private void button85_Click(object sender, EventArgs e)        {            if (button85.BackColor == Color.Silver)                button85.BackColor = coo[85];            else            {                coo[85] = button85.BackColor;                button85.BackColor = Color.Silver;            }        }        private void button86_Click(object sender, EventArgs e)        {            if (button86.BackColor == Color.Silver)                button86.BackColor = coo[86];            else            {                coo[86] = button86.BackColor;                button86.BackColor = Color.Silver;            }        }        private void button87_Click(object sender, EventArgs e)        {            if (button87.BackColor == Color.Silver)                button87.BackColor = coo[87];            else            {                coo[87] = button87.BackColor;                button87.BackColor = Color.Silver;            }        }        private void button88_Click(object sender, EventArgs e)        {            if (button88.BackColor == Color.Silver)                button88.BackColor = coo[88];            else            {                coo[88] = button88.BackColor;                button88.BackColor = Color.Silver;            }        }        private void button89_Click(object sender, EventArgs e)        {            if (button89.BackColor == Color.Silver)                button89.BackColor = coo[89];            else            {                coo[89] = button89.BackColor;                button89.BackColor = Color.Silver;            }        }        private void button90_Click(object sender, EventArgs e)        {            if (button90.BackColor == Color.Silver)                button90.BackColor = coo[90];            else            {                coo[90] = button90.BackColor;                button90.BackColor = Color.Silver;            }        }        private void button91_Click(object sender, EventArgs e)        {            if (button91.BackColor == Color.Silver)                button91.BackColor = coo[91];            else            {                coo[91] = button91.BackColor;                button91.BackColor = Color.Silver;            }        }        private void button92_Click(object sender, EventArgs e)        {            if (button92.BackColor == Color.Silver)                button92.BackColor = coo[92];            else            {                coo[92] = button92.BackColor;                button92.BackColor = Color.Silver;            }        }        private void button93_Click(object sender, EventArgs e)        {            if (button93.BackColor == Color.Silver)                button93.BackColor = coo[93];            else            {                coo[93] = button93.BackColor;                button93.BackColor = Color.Silver;            }        }        private void button94_Click(object sender, EventArgs e)        {            if (button94.BackColor == Color.Silver)                button94.BackColor = coo[94];            else            {                coo[94] = button94.BackColor;                button94.BackColor = Color.Silver;            }        }        private void button95_Click(object sender, EventArgs e)        {            if (button95.BackColor == Color.Silver)                button95.BackColor = coo[95];            else            {                coo[95] = button95.BackColor;                button95.BackColor = Color.Silver;            }        }        private void button96_Click(object sender, EventArgs e)        {            if (button96.BackColor == Color.Silver)                button96.BackColor = coo[96];            else            {                coo[96] = button96.BackColor;                button96.BackColor = Color.Silver;            }        }        private void button97_Click(object sender, EventArgs e)        {            if (button97.BackColor == Color.Silver)                button97.BackColor = coo[97];            else            {                coo[97] = button97.BackColor;                button97.BackColor = Color.Silver;            }        }        private void button98_Click(object sender, EventArgs e)        {            if (button98.BackColor == Color.Silver)                button98.BackColor = coo[98];            else            {                coo[98] = button98.BackColor;                button98.BackColor = Color.Silver;            }        }        private void button99_Click(object sender, EventArgs e)        {            if (button99.BackColor == Color.Silver)                button99.BackColor = coo[99];            else            {                coo[99] = button99.BackColor;                button99.BackColor = Color.Silver;            }        }        private void button100_Click(object sender, EventArgs e)        {            if (button100.BackColor == Color.Silver)                button100.BackColor = coo[100];            else            {                coo[100] = button100.BackColor;                button100.BackColor = Color.Silver;            }        }        private void button101_Click(object sender, EventArgs e)        {            colorKind = -1;            if (radioButton1.Checked) colorKind = 1;            if (radioButton2.Checked) colorKind = 2;            if (radioButton3.Checked) colorKind = 3;            if (radioButton4.Checked) colorKind = 4;            if (radioButton5.Checked) colorKind = 5;            if (radioButton6.Checked) colorKind = 6;            foreach (Control i in this.Controls)            {                if (i.Name.Length < 6) continue;                string x = i.Name.Substring(0, 6);                if (x == "button")                {                    if (i.BackColor == Color.Silver)                    {                        int t = Convert.ToInt32(i.Name.Substring(6, i.Name.Length - 6));                        if (!(t >= 1 && t <= 100)) continue;                        switch (colorKind)                        {                            case -1: MessageBox.Show("please select a color !"); break;                            case 1: coo[t] = Color.Red; i.BackColor = Color.Red; break;                            case 2: coo[t] = Color.Gold; i.BackColor = Color.Gold; break;                            case 3: coo[t] = Color.SkyBlue; i.BackColor = Color.SkyBlue; break;                            case 4: coo[t] = Color.SpringGreen; i.BackColor = Color.SpringGreen; break;                            case 5: coo[t] = Color.Orchid; i.BackColor = Color.Orchid; break;                            case 6: coo[t] = Color.White; i.BackColor = Color.White; break;                        }                    }                }            }        }        private void button102_Click(object sender, EventArgs e)        {            foreach (Control i in this.Controls)            {                if (i.Name.Length < 6) continue;                string x = i.Name.Substring(0, 6);                if (x == "button")                {                    int t = Convert.ToInt32(i.Name.Substring(6, i.Name.Length - 6));                    if (!(t >= 1 && t <= 100)) continue;                    i.BackColor = Color.White;                    coo[t] = Color.White;                }            }        }        private void button103_Click(object sender, EventArgs e)        {            FileStream fs = new FileStream("c:\\hello.txt", FileMode.Create);            StreamWriter sw = new StreamWriter(fs);            string anst="";            for (int i = 1; i <= 100;++i )            {                int ct = -1;                if (coo[i] == Color.White) ct = 0;                if (coo[i] == Color.Red) ct = 1;                if (coo[i] == Color.Gold) ct = 2;                if (coo[i] == Color.SkyBlue) ct = 3;                if (coo[i] == Color.SpringGreen) ct = 4;                if (coo[i] == Color.Orchid) ct = 5;                if (i % 10 == 0)                {                    anst += ct.ToString();                    sw.WriteLine(anst);                    anst = "";                }                else                {                    anst += (ct.ToString()+" ");                }            }            sw.Flush();            sw.Close();            fs.Close();            MessageBox.Show("done !");        }    }}

 

popStar机机对战数据生成器代码(C#)