C#2.0中使用的HashSet,与3.5兼容 [英] Using HashSet in C# 2.0, compatible with 3.5

查看:306
本文介绍了C#2.0中使用的HashSet,与3.5兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的想用hashsets在我的计划。使用字典觉得难看。我可能会开始使用VS2008与.net 3.5某一天,所以我的理想是,即使我不能(或可以吗?)使用的 hashsets 的在VS2005,当我开始使用.net 3.5,我不希望有太大的变化,如果有的话,以切换到使用这些hashsets。

I really want to use hashsets in my program. Using a dictionary feels ugly. I'll probably start using VS2008 with .Net 3.5 some day, so my ideal would be that even though I can't (or can I?) use hashsets in VS2005, when I start using .NET 3.5, I don't want to have to change much, if anything, in order to switch to using these hashsets.

我想知道是否有人知道的现有HashSet的实现设计考虑到这一点,还是有办法使用3.5的HashSet在VS2005。

I am wondering if anyone is aware of an existing hashset implementation designed with this in mind, or a way to use the 3.5 hashset in VS2005.

推荐答案

您可以使用的HashSet< T> 在现在2.0的应用程序 - 只是参考System.Core.dll的你应该是好去。

You can use HashSet<T> in a 2.0 application now - just reference System.Core.dll and you should be good to go.

注意:这将需要您安装<一href="http://www.microsoft.com/downloads/details.aspx?FamilyID=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en">.NET 3.5框架这是免费的,独立于Visual Studio中。一旦你的安装,你将有新的System.Core程序组件,包含的HashSet&LT; T&GT; 键入。由于.NET框架版本2.0 - 3.5都有着相同的CLR,您可以在2.0应用程序中使用该组件没有任何问题

Note: This would require you to install the .NET 3.5 framework which is free and separate from Visual Studio. Once you have that installed you will have the new System.Core assembly which contains the HashSet<T> type. Since the .NET frameworks versions 2.0 - 3.5 all share the same CLR you can use this assembly in your 2.0 application without any issues.

这篇关于C#2.0中使用的HashSet,与3.5兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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