-
March 3rd, 2002, 02:59 AM
#1
Quick VB Question
I should probably know this, what with all the tutorials I've read, and the little things I've programmed, but I don't.
I'm making a program that will find and save a URL, but I don't know how to get it to recognize the entire URL. Basically, I can get it to find the "http://" and the ".com" but I don't know how to tell it to accept what's in the middle.
I'm guessing someone out there knows how?
-
March 3rd, 2002, 03:05 AM
#2
Senior Member
I am not fluent in VB and I don't know the answer, but I am just curious, if you are making a program that saves web pages, why are you using VB?
Not saying anything about you, but why would you use Visual Basic to make a real program. I have seen it used to make prototypes and shells but why would you use it to make a full program?
\"To follow the path:
look to the master,
follow the master,
walk with the master,
see through the master,
become the master.\"
-Unknown
-
March 3rd, 2002, 03:12 AM
#3
I'm using it to see if VB CAN make a real program. I mean, a VB program that actually does something is not a bad concept, right? Or am I just clinging to some worthless hope that this language is actually someone useful?
Anyway, please, no one make fun of me for my choice of languages, just tell me how...
-
March 3rd, 2002, 03:19 AM
#4
Senior Member
Sorry did not mean to be making fun of you. But anyway good luck then.
\"To follow the path:
look to the master,
follow the master,
walk with the master,
see through the master,
become the master.\"
-Unknown
-
March 3rd, 2002, 03:23 AM
#5
On request, I will try to elaborate.
Program downloads HTML file to RichTextBox. Program then starts the following code:
SearchStr = "http://"
Search2 = ".com"
FoundPos = HTMLbox.Find(SearchStr + **what goes here??** + Search2)
'if the word is found (if not -1)
If FoundPos <> -1 Then
MsgBox "Valid link found", , "Find"
'add to record...
Does this clarify it any?
-
March 3rd, 2002, 03:56 AM
#6
Ok, what you're attempting to do with the following code is a wildcard search. I'm still not entirely sure of what you're asking but I hope this helps.
Code:
FoundPos = HTMLbox.Find(SearchStr + **what goes here??** + Search2)
This won't work unless the Find function supports wildcards searches (which I doubt). What I suggest is this:
Code:
position1 = HTMLbox.Find("http://")
position2 = HTMLbox.Find(".com")
If (position1 <> -1) Then
If (position2 <> -1) Then
MsgBox "Valid link found", , "Find"
'add to record...
Good luck .
OpenBSD - The proactively secure operating system.
-
March 3rd, 2002, 04:32 AM
#7
Still couldn't get it to work, it finds the position1 but not position2. Thanks, though.
-
March 3rd, 2002, 04:37 AM
#8
I'm not sure why you would want to search for ".com" anyway since sites can have other domains (.gov, .edu....). What is the URL you're doing the Find on? What feedback are you getting? The more info you give, the easier it is to help .
OpenBSD - The proactively secure operating system.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|