session保存数组和读出数组!

来源:互联网 发布:网络高级骗术 编辑:程序博客网 时间:2024/06/11 20:29

保存数组

 

       string[] itemcontent = new string[newCount];

        for (int i = 0; i < newCount;i++ )
        {
            itemcontent[i] = this.ListBox3.Items[i].Value;
        }
       
        Session["count"] = newCount.ToString();
        Session["Itemsender"] = itemcontent;

 

        Server.Transfer("preview.aspx");

 

 

 

 

在 preview.aspx页面中读出

 

            

             int col_count = Convert.ToInt32(Session["count"]);//listbox3中的列数

             string[] Itemreceiver = new string[col_count];
             Itemreceiver = (string[])Session["Itemsender"];

原创粉丝点击