惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Martin Fowler
Martin Fowler
雷峰网
雷峰网
IT之家
IT之家
小众软件
小众软件
M
MIT News - Artificial intelligence
博客园 - 聂微东
J
Java Code Geeks
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
About on SuperTechFans
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
Recent Announcements
Recent Announcements
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
C
Check Point Blog
云风的 BLOG
云风的 BLOG
腾讯CDC
H
Help Net Security
Y
Y Combinator Blog
I
InfoQ

博客园 - 零点时刻

一千万条数据数据搜索问题! 嵌套DataGrid,中如何添加删除事件?(望能暂时放一下,谢谢了!) 嵌套DataGrid,中如何添加删除事件? 计算机类资源网:http://www.3human.com/ 互动形式 用户可以上传资料 今天心情有点郁闷! 动态加载用户控件的组件!(二) (转) 动态加载用户控件的组件!(四) Asp.Net Forums研究文章集合(收藏) 【MasterPages实用技巧】为模板增加前端控制①——自动生成页面标题 【MasterPages实用技巧】使用MasterPages实现Web窗体模板 CS研究笔记-缓存 (转) Community Server专题四:HttpHandler Community Server专题八:MemberRole之Membership (转) 主板故障的分析和诊断 http://www.metabuilders.com/ 的MasterPages 控件可以多重嵌套 动态加载用户控件的组件!(转) 自定义控件主题使用研究 MasterPages(转载) 我的野外拍摄
c# arraylist functions
零点时刻 · 2006-04-06 · via 博客园 - 零点时刻

When you put then in the array list you could check to see if the item already exists.  This code snippet will check to see if the string is already in the array and will only add it when the item doesn't already exist in the list.

static void Main( string[] args )
{
 ArrayList list = new ArrayList();

 AddToList( list, "Table1" );
 AddToList( list, "Table4" );
 AddToList( list, "Table1" );
 AddToList( list, "Table3" );
 AddToList( list, "Table2" );
 AddToList( list, "Table2" );

foreach ( string s in list ) //this will loop the collection to show there are no duplicates
 {
  Console.WriteLine( s );
 }
}

private static void AddToList( ArrayList list, string p )
{
 if ( list.Contains( p ) == false )
  list.Add( p );
}