Thread: Question Problem with Array.IndexOf
View Single Post
  #6 (permalink)  
Old 06-26-2009, 8:05 PM
JohnH's Avatar
JohnH JohnH is offline
VB.NET Forum Moderator
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Dec 2005
Location: Norway
Age: 37
Posts: 10,325
Reputation: 1315
JohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond repute
Default

The code works as expected, but the search is case-sensitive, could that be why?

Also, this code is better:
Code:
Dim folder As String = Request.QueryString("f")
Dim search As String = Request.QueryString("i")
Dim filenames As New List(Of String)
For Each filepath As String In IO.Directory.GetFiles(folder, "*.jpg")
    filenames.Add(IO.Path.GetFileNameWithoutExtension(filepath))
Next
Dim currentIndex As Integer = filenames.IndexOf(search)
__________________
Reply With Quote