日期:2014-05-17  浏览次数:20833 次

C#新建cs中为啥datagridview没数据的?
 public class lineIP
        {
            public string[] line1_name = { "a", "B", "C", "D", "X" };
            public string[] line1_ip = new string[5];


            public string[] line2_name = { "1", "2", "3", "4" };
            public string[] line2_ip = new string[4];


            public string[] ceshi_name = { "百度", "新浪", "本机", "腾讯" };
            public string[] ceshi_ip = { "202.108.22.5", "202.108.33.74", "192.168.0.1", "182.254.0.217" };


            public lineIP()
            {
                for (int a = 0; a < 5; a++)
                {
                    line1_ip[a] = "10.121.111." + a;
                }

                for (int b = 0; b < 4; b++)
                {
                    line2_ip[b] = "10.132.222." + b;
                }
            }


        }


 public void chezhan_name_select()
        {
            if (chezhan_ip == null)
            chezhan_ip = new System.Windows.Forms.DataGridView();
            lineIP lineip = new lineIP();

            MessageBox.Show(lineip.line1_name.Count().ToString() + "11111");
            //这句话能显示

            switch (x)
            {
                case 1:
                    for (int i = 0; i < lineip.line1_name.Count();&nbs