473,320 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Search a textbox for particular text

32
hi in a project that im working on i load a web page source into a textbox and then from that text i try to find files on the web page and then makes a new item in a listbox with the file name text as the item text e.g(http://bytes.com/images/logo4.gif) (then you can download the file). I kinda got a way of doin it but it doesent work any good. The download part works perfect its just the finding files in the source.

I came up with this coding and there are 4 things wrong with it
1. way to long
2.doesent always find files
3. mostly it comes up with stuff like "httpgif"
4. sometimes come up with errors


Expand|Select|Wrap|Line Numbers
  1.   Dim flv_reader As String = String.Empty
  2.         Dim e As Integer = 0
  3.         Dim flv_eq As Integer = 0
  4.         Dim flv_dot As Integer = 0
  5.         Dim flv_file As String = String.Empty
  6.         For e = 0 To txts.Lines.Length - 1
  7.             flv_reader = txts.Lines(e)
  8.             'find the .swf
  9.             If flv_reader.Contains(".flv") Then
  10.                 'find the :
  11.                 Dim f As Integer = 0
  12.                 For f = 0 To flv_reader.Length - 1
  13.                     If flv_reader.Chars(f) = ":" Then
  14.                         flv_eq = f
  15.                     End If
  16.                 Next
  17.                 'find the .
  18.                 Dim g As Integer = flv_eq
  19.                 For g = flv_eq To flv_reader.Length - 1
  20.                     If flv_reader.Chars(g) = "." Then
  21.                         flv_dot = g
  22.                     End If
  23.                 Next
  24.                 'Me.Text = swf_dot
  25.                 'get text betwwen the 2
  26.                 Dim h As Integer = 0
  27.                 For h = flv_eq To flv_dot
  28.                     flv_file += flv_reader.Chars(h)
  29.                 Next
  30.                 'add http and swf
  31.                 flv_file = "http" + flv_file + "flv"
  32.                 'clean the search
  33.                 If flv_file.Contains("<") = False Then
  34.                     If flv_file.Contains("""") = False Then
  35.                         lstfiles.Items.Add(flv_file)
  36.                     End If
  37.                 End If
  38.             End If
  39.         Next
  40.  
Apr 11 '08 #1
0 969

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Colleyville Alan | last post by:
I have a incremental search box that has been working fine for a couple of months but is now acting up. This search box is from the cd that comes with Getz's book, so I did not write it and have...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
4
by: Jurjen de Groot | last post by:
I'm developing a ASP.NET/VB.NET web application. (VS.NET 2003) I've created several webpages, but on two pages one textbox colors yellow (the background) and I can't get the background to appear...
4
by: bj daniels | last post by:
I have a sql server (2000) and I want to add a search capability to my asp.net page. It will search an Articles table - in particular the 'Article' field (ntext). I started with the following...
0
by: Arun Nair | last post by:
Hi, I have an Employerregistration pagethat is used to add new Empoyers to a table. I also have another form search.aspx used to search the employers(based on their id) and edit the employer...
1
by: ratnakarp | last post by:
Hi, I have a search text box. The user enters the value in the text box and click on enter button. In code behind on button click i'm writing the code to get the values from the database and...
5
by: DFS | last post by:
This works pretty well, and it's easy, but it's not the ultimate solution. The kludgey part is it uses a hidden field to incrementally capture the keystrokes in the visible field (because executing...
0
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only,...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.