web NameValueCollection多组数据 提供查询

using System.Collections.Specialized;   

NameValueCollection mycol = new NameValueCollection();
                string[] valueeach = valuelist.Split(',');
                int count = valueeach.Length / 8;
                for (int i = 0; i < count; i++)
                {
                    string pnindex = valueeach[i * 8].ToString();
                    string typeindex = valueeach[i * 8 + 6].ToString();
                    if (mycol["pnindex"] == null)
                    {
                        mycol.Add(pnindex, typeindex);
                    }
                    if (mycol["pnindex"] != typeindex)
                    {
                        WFWMS.Lib.MessageBox.Show(this.Page, "相同的PN或型号的报废类别必须相同");
                        return;
                    }
                }

posted @ 2012-11-23 08:26  洗耳恭听兼烂笔头  阅读(141)  评论(0编辑  收藏  举报