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

C# 新手问题
public partial class Form1 : Form
    {
        private ArrayList List = new ArrayList();


        public Form1()
        {
            InitializeComponent();

            List.Add("1");
            List.Add("2");
            List.Add("3");
            List.Add("4");
            List.Add("5");
            List.Add("6");
            List.Add("7");
            List.Add("8");

        }

        private void button1_Click(object sender, EventArgs e)
        {
            
        }
    }

新手 轻喷
我现在List中都是字符串  我想转化为int
这应该怎么做啊?  
我要是点击botton1  有一个messagebox 把奇数 偶数分开...
新手  望大神们 帮我一下

------解决方案--------------------
按照你的要求,我写了一个好理解的。
 private static ArrayList List = new ArrayList();

        private void button1_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < List.Count; i++)
            {
                int value = Convert.ToInt32(List[i]);