呵呵,我以前就定义过类似的结构,但证名是有问题的,原因在于:
结构本身是值类型,数组是引用类型,那么这样就会造成“马车拉宝马”(这句话是别人说我的,我觉得很形象)的效果,所以尽量不要这样定义,把结构改成类吧

解决方案 »

  1.   


    public partial class ListView : System.Web.UI.Page
    {
        
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Write(this.GetIP());
            mystruct a = new mystruct();
            a.a = new ArrayList();
            a.aa = new string[] { "1", "2" };
            a.aaa = new int[] { 0, 1 };
        }
        public struct mystruct
        {
            public ArrayList a;
            public string[] aa;
            public int[] aaa;
        }
    }