DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: how to retrive text from a web site and put in vb 6 form

  1. #1
    Join Date
    Dec 2006
    Posts
    16

    how to retrive text from a web site and put in vb 6 form

    I want to retrive text lines which it is 8 number or alphabet long from a web site how or what code i should write so when a command button is pressed the text message or numbers display in the text bar above command button.
    Thank you for read my post

  2. #2
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    Use "Internet transfere control" .
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  3. #3
    Join Date
    Dec 2006
    Posts
    16
    I am really a fresh on board do they have any tutorial on Internet transfere control.

  4. #4
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    It's very easy :
    -Put an Internet transfere control.
    -Call it inet1 say.
    -the readen string from the url : "ww.xyz. com" is the return value from this : Inet1.OpenURL("ww.xyz. com")

    e.g. if your text exist in this location : myweb/txt.tx
    then you can read it by :
    str = Inet1.OpenURL("myweb/txt.tx")
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  5. #5
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    do u know how to put a control ?
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  6. #6
    Join Date
    Dec 2006
    Posts
    16
    no clue any tutorial I am willing to read and learn

  7. #7
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    ok follow this :

    -open a new simple vb project
    -press (Ctrl+t)
    -in controls choose "Micro$oft internet transfere control"
    -press ok

    Now u will have a new component that appear in the left toolbar [a small computer and behind it the earth]
    -choose this control and put it in any place on the form
    -make a new command button
    -on it's click event put this code :
    Dim str As String
    str = Inet1.OpenURL("myweb/text.txt")
    MsgBox str

    Where "myweb/text.txt" is the web adress of the text u want getting it's content .
    after compiling you will got it's containing in the msgbox .

    [u can test it with "www . msn . com" for example .
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  8. #8
    Join Date
    Dec 2006
    Posts
    16
    hi
    I did try this without compiling like in vb 6 you have option to play and when i click on it , it brings up a large rectangular window saying project one and all that web crap stuff such as <!DOCtypehtml public and ...........stuff I putted in www.msn.com as web url to test... what i wanted it to do was display 32 letter and number mix on each text box i have added on the form.

    About the compiler which compiler should i use do they have any freeware compiler or trial compiler u know of. Thansk a lot for help me my friend

  9. #9
    Join Date
    Dec 2006
    Posts
    16
    Amahdy can I email you if you dont mind my friend

  10. #10
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819

    Arrow

    Quote Originally Posted by haris2k7
    hi
    I did try this without compiling like in vb 6 you have option to play and when i click on it
    And u r not using vb 6 ? or what ?

    Quote Originally Posted by haris2k7
    it brings up a large rectangular window saying project one and all that web crap stuff such as <!DOCtypehtml public and ...........stuff I putted in www.msn.com as web url to test...
    This rectangular window is the MessageBox I told u about it later , and it contains the url scripts , I mean HTML language and any other scripts on this webpage ..

    Quote Originally Posted by haris2k7
    what i wanted it to do was display 32 letter and number mix on each text box i have added on the form.
    you must specify those letters exist where in your website , make some prossesing on the returning string to split it in your textboxes .

    Quote Originally Posted by haris2k7
    About the compiler which compiler should i use do they have any freeware compiler or trial compiler u know of. Thansk a lot for help me my friend
    they who ? maybe u have a confusion here but anyway if u use vb6 u don't have to do anything else ! just make run as u did before or (ctrl+f5) to compile and run .
    U r welcome any time
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  11. #11
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819

    Arrow

    Quote Originally Posted by haris2k7
    Amahdy can I email you if you dont mind my friend
    I don't mind I'm already sharing my Yahoo ID , but I think it's preferable to post here to have solutions for every body !

    Okey tell me what's your problem or u stop where .
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  12. #12
    Join Date
    Dec 2006
    Posts
    16
    "you must specify those letters exist where in your website , make some prossesing on the returning string to split it in your textboxes ."

    Can you give an example of it please.

  13. #13
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    Okey there is a function called InStr() that search for a string ;
    If u want to search where is the string "efg" in "abcdefg" for example :
    a = InStr(1, "abcdefg", "efg") 'result = 5
    Now u must do this search into your string ; to find where is the searched string :
    a = InStr(1, str, "Line1")
    then start from this point to get the whole first line :
    b = Mid(str, a, "end_of_line1")
    here b contains what u want :
    text1.text = b
    and that's all

    same thing for all the string until you get all lines you want .
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  14. #14
    Join Date
    Dec 2006
    Posts
    16
    If InStr(Text3.Text, Dish00) = 0 And Dish00 <> ExDish00 And InStr(Text3.Text, ExDish00) = 0 Then
    Text3.Text = Text3.Text + ExDish00 + Chr$(13) + Chr$(10)
    End If
    If InStr(Text3.Text, Dish01) = 0 And Dish01 <> ExDish01 And InStr(Text3.Text, ExDish01) = 0 Then
    Text3.Text = Text3.Text + ExDish01 + Chr$(13) + Chr$(10)
    End If
    If InStr(Text3.Text, Bev00) = 0 And Bev00 <> ExBev00 And InStr(Text3.Text, ExBev00) = 0 Then
    Text3.Text = Text3.Text + ExBev00 + Chr$(13) + Chr$(10)
    End If
    If InStr(Text3.Text, Bev01) = 0 And Bev01 <> ExBev01 And InStr(Text3.Text, ExBev01) = 0 Then
    Text3.Text = Text3.Text + ExBev01 + Chr$(13) + Chr$(10)
    End If
    If Len(Text3.Text) > 1700 Then
    Text3.Text = Right(Text3.Text, 1700)
    End If <?????

  15. #15
    Join Date
    Dec 2006
    Posts
    16
    If InStr(Text3.Text, Bev00) = 0 And Bev00 <> ExBev00 And InStr(Text3.Text, ExBev00) = 0 Then
    Text3.Text = Text3.Text + ExBev00 + Chr$(13) + Chr$(10)
    End If
    If InStr(Text3.Text, Bev01) = 0 And Bev01 <> ExBev01 And InStr(Text3.Text, ExBev01) = 0 Then
    Text3.Text = Text3.Text + ExBev01 + Chr$(13) + Chr$(10)
    End If
    If Len(Text3.Text) > 1700 Then
    Text3.Text = Right(Text3.Text, 1700)
    End If What will this instr cammand do

Similar Threads

  1. Creating a master web form in c# and .net
    By Jsutin in forum ASP.NET
    Replies: 4
    Last Post: 06-27-2002, 01:12 PM
  2. Is there a way to create a master Web Form
    By Justin in forum Architecture and Design
    Replies: 0
    Last Post: 06-20-2002, 04:06 PM
  3. They created J#, why couldn't they do VB#?
    By Thomas Eyde in forum .NET
    Replies: 290
    Last Post: 12-22-2001, 03:13 PM
  4. Determining when a user leaves your web site
    By Manoj in forum Enterprise
    Replies: 0
    Last Post: 06-28-2001, 09:56 AM
  5. New web site
    By Cliff Cavin in forum vb.announcements
    Replies: 0
    Last Post: 04-05-2001, 06:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center