转自:http://blog.csdn.net/happymagic/article/details/6973831

法一:

string[] s1 = new string[3] { "John", "Paul", "Mary" };
if (s1.Contains("John"))
Response.Write("fadfadfa");

法二:

int[] ia = {1,2,3};
int id = Array.IndexOf(ia,value);

if(id==-1)
不存在
else
存在



本文转载:CSDN博客