以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  如何判断某个字符串在集合内  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=47401)

--  作者:wuxianzuoji41
--  发布时间:2014/3/9 22:53:00
--  如何判断某个字符串在集合内

集合为

Dim ftp1 As New FtpClient
Dim
fls As List(of String)
ftp1.Host=
"196.128.143.28"
ftp1
.Account = "foxuser"
ftp1
.Password = "138238110"
fls = ftp1.GetFileList(
"\\photo")
For Each
fl As String In fls
   
Output.Show(fl)
Next

 

如何如何判断某个字符串在集合内,也就是判断文件名和FTP目录的文件名是否有重复


--  作者:有点酸
--  发布时间:2014/3/9 23:05:00
--  

For Each fl As String In fls

     if fl = "abc" then

         messagebox.show("abc在里头")

     end if

next


--  作者:逛逛
--  发布时间:2014/3/10 7:53:00
--  
List(of T)   有  Contains 的方法,判断集合中是否包括某个值