从列表框中选择种子文件时出现异常 [英] I'm getting an exception when selecting torrent files from a list box

查看:52
本文介绍了从列表框中选择种子文件时出现异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从列表框中选择torrent文件时出现异常

指定的键在字典中不存在.



I''m getting an exception when selecting torrent files from a list box

The given key was not present in the dictionary.



public IList<TorrentManager> GetSelectedTorrents()
       {
           IList<TorrentManager> result = new List<TorrentManager>();

               foreach (ListViewItem item in mainForm.TorrentsView.SelectedItems)
                   result.Add(itemToTorrent[item]);


           return result;
       }

推荐答案

错误说明了一切.您要搜索的关键字项在搜索的词典集合中不存在.
在调试器中检查密钥的值,以确保它们是您认为的样子.
The error speaks for itself. The item you are looking for by key does not exist in the dictionary collection you are searching in.
Check the value of your keys in the debugger to make sure that they are what you think they are.


这篇关于从列表框中选择种子文件时出现异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆