string str="dir";string[] ia = {a dir c,a dir d,a b c};int id = Array.IndexOf(ia,str);if(id==-1){//不存在}string[] strArr = {"a","b","c","d","e"};bool exists = ((IList)strArr).Contains(str);if(exists) // 存在else// 不存在