网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > C#应用
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.C#中使用SendMessage.
.C# Google PageRank .net库 (che.
.C#实现根据域名查询ip实例.
.在C#中使用可空类型.
.C#几种常用的排序算法.
.防SQL注入攻击.
.C#图像放大问题解决方法.
.Vsiaul C#如何读取注册信息.
.2进制、8进制、10进制、16进制...
.利用c#制作简单的留言板(3) .
.从DataGridView控件托放数据到Tr.
.使用C#编写一个计时器.
.C#结合串口通信类实现串口通信源.
.发送邮件程序(Csharp2005).
.给datagrid的按钮列添加css.
.用Visual C#来增加数据记录(1).
.C#中接口的深入浅出.
.c#摄氏华氏转换.
.用C#做ScreenSaver.
.C#中实现VB中的CreateObject方法.

c# arraylist functions

发表日期:2006-4-7


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 );
}


 

上一篇:用c#监控网络流量 人气:8285
下一篇:在C#里使用using操作符 人气:6655
浏览全部c#的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐