可以返回不定维数组,以下是一个示例
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }        private void button1_Click(object sender, EventArgs e)
        {
            executeItemInfo[] abc=new executeItemInfo[2];
            abc[0] = new executeItemInfo("no 0","cz0");
            abc[1] = new executeItemInfo("no 1", "cz1");
            object obj = abc;
            executeItemInfo[] bc = (executeItemInfo[])obj;
            textBox1.Text = bc[0].IP .ToString();        }    }
    /// <summary>
    /// 防火墙IP状态实体类
    /// </summary>
    [Serializable]
    public class executeItemInfo
    {
        private string ip;
        private string cz;
        public executeItemInfo() { }
        public executeItemInfo(string ip, string cz)
        {
            this.ip = ip;
            this.cz = cz;
        }        public string IP { get { return ip; } }
        public string CZ { get { return cz; } }
    }

解决方案 »

  1.   

    allopcserver 是定义的一个数组?楼主应该 知道 一个 基础 知识 对于想c/c++ c#这样的面向对象 语言都不存在 直接 数组 赋值 给另一个数组的语法
    比如 
    int[] ie = {1,2,3,4};
    是不能直接int[] x = ie; //这样是错误的而必须
    int[] x = new int[4];
    for (int ix=0; ix<ie.Length; ix++)
    {
    x[ix] = ie[ix];
    }
      

  2.   

    参考http://topic.csdn.net/t/20060831/18/4990105.html
      

  3.   

    没有办法把程序给大家看,我现在只是想知道,如何把object类型的变量里面存放的string[]数据元素提取出来?!请大家帮帮忙/
      

  4.   

    感觉你的Object里面放的不是string[],而可能是多维的
    如果维数不定
    那就解决不了了
    除非有其他途径知道具体返回几维的
      

  5.   


    把它强转成arraylist看看或者List<string>