lorena
Well-known member
I am trying to create a search page in VS 2003 that will search all of the subfolders in a directory. I had a way to do it in asp but .NET is different.
I tried this:
Any suggestions would be appreciated.
I tried this:
Code:
Dim strPath As String = "/intranet/Quality/Discrepancy Reports Closed"
Dim strQuery As String
Dim myDirInfo As DirectoryInfo
strQuery = txtQuery.Text
If strQuery = "" Then strQuery = CStr(Request.QueryString("query"))
txtQuery.Text = strQuery
myDirInfo = New DirectoryInfo(Server.MapPath(strPath))
dgFiles.DataSource = myDirInfo.GetFiles("*" & strQuery & "*") dgFiles.DataBind()