Quick VB Question
Results 1 to 8 of 8

Thread: Quick VB Question

  1. #1
    Senior Member
    Join Date
    Oct 2001
    Posts
    484

    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?
    Why am I still here?

  2. #2
    Senior Member
    Join Date
    Feb 2002
    Posts
    120
    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

  3. #3
    Senior Member
    Join Date
    Oct 2001
    Posts
    484
    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...
    Why am I still here?

  4. #4
    Senior Member
    Join Date
    Feb 2002
    Posts
    120
    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

  5. #5
    Senior Member
    Join Date
    Oct 2001
    Posts
    484
    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?
    Why am I still here?

  6. #6
    Senior Member
    Join Date
    Oct 2001
    Posts
    638
    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.

  7. #7
    Senior Member
    Join Date
    Oct 2001
    Posts
    484
    Still couldn't get it to work, it finds the position1 but not position2. Thanks, though.
    Why am I still here?

  8. #8
    Senior Member
    Join Date
    Oct 2001
    Posts
    638
    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
  •  

 Security News

     Patches

       Security Trends

         How-To

           Buying Guides