GIDForums  

Go Back   GIDForums > Computer Programming Forums > .NET Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 30-Jun-2007, 07:19
AnaXyd AnaXyd is offline
New Member
 
Join Date: Aug 2005
Posts: 10
AnaXyd is on a distinguished road

An advanced search function...!


Hello..! I got help here for around two years ago, with a search function.

So, I just started up with that project again, and now I want it to be complete! (Last time, I gave up)

Well, I know you guys here got the competance, and the experience with this!

Oh yes! The code:
VB / Visual Basic Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        '        String [] pictureFiles = new String[200];
        Dim fileNameToFind As String
        fileNameToFind = Textbox1.text '<--
        Dim currentDirectory As String
        Dim strVector() As String
        Dim fileName As String

        Try
            currentDirectory = TextBox2.Text '<--

            ' Let's see the directory we are searching
            MessageBox.Show(currentDirectory)
            If (System.IO.Directory.Exists(currentDirectory)) Then
                ' Get all the files in the directory
                strVector = System.IO.Directory.GetFiles(currentDirectory)
                Dim i As Int16
                Do
                    ' Cut down the file to only it's name (eliminate the path)
                    fileName = strVector(i).Substring(strVector(i).LastIndexOf("\") + 1)
                    ' Does the name match with the one we are looking for?
                    If (fileName.Equals(fileNameToFind)) Then
                        MessageBox.Show(fileNameToFind + " was found at position " + i.ToString() + " in " + currentDirectory)
                    End If
                    i = i + 1
                Loop Until (i >= strVector.Length)

            End If

        Catch ex As Exception
            MessageBox.Show(ex.ToString())


        End Try

    End Sub
Yeah... If this could be shaped like an advanced search function after spyware, then i have succeded!
So, is it possible to make a progressbar, for the search? And make it search for another file when the first one is found?
And list the found names in a listbox, instead of showing messageboxes?

I dont know how to do this myself, so if you could help me it would be great!
Last edited by LuciWiz : 30-Jun-2007 at 07:33. Reason: Please insert your Visual Basic code between [vb] & [/vb] tags
 
 

Recent GIDBlogInstall Adobe Flash - Without Administrator Rights by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] Doubly-linked List dsmith C Programming Language 6 14-Apr-2006 13:12
[Tutorial] Function Pointers aaroncohn C++ Forum 4 17-Feb-2006 11:33
Revising Script style ?????? pepee MySQL / PHP Forum 4 14-Apr-2004 04:59
Search Engine Positioning 101 and 201 "How To" Tips... 000 Search Engine Optimization Forum 0 29-May-2003 10:34
[class] 404 search function code jrobbio MySQL / PHP Forum 6 22-Apr-2003 09:32

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 06:36.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.