首页 > 编程语言 > 详细

按照添加顺序排序的键值对

时间:2015-11-28 16:41:55      阅读:398      评论:0      收藏:0      [点我收藏+]

DictionaryEntry是单个键值对的类型

利用list的特性,完成按添加顺序排好的键值对

      

public List<DictionaryEntry> UrlList { get { return urlList; } }

 

DictionaryEntry de = new DictionaryEntry();

                de.Key = dph.FilePath; de.Value = dph.ImgUrl;

                urlList.Add(de);

 

foreach (DictionaryEntry de in urllist)

 {

    System.Drawing.Image tempimage = System.Drawing.Image.FromFile(de.Key.ToString());//图片路径

    int imagewidth = tempimage.Width;//宽

    int imageheight = tempimage.Height;//高

    if (imagewidth > 320 && imageheight > 320)

    {

        dph.GetPicThumbnail(320, 320, 50, de.Key.ToString());

                        break;

        }

  }

}

按照添加顺序排序的键值对

原文:http://www.cnblogs.com/sulong/p/5002773.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!