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
[257 byte] By [
haris2k7] at [2007-11-11 10:04:34]

# 1 Re: how to retrive text from a web site and put in vb 6 form
Use "Internet transfere control" .
Amahdy at 2007-11-11 17:23:21 >

# 2 Re: how to retrive text from a web site and put in vb 6 form
I am really a fresh on board do they have any tutorial on Internet transfere control.
# 3 Re: how to retrive text from a web site and put in vb 6 form
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")
Amahdy at 2007-11-11 17:25:20 >

# 4 Re: how to retrive text from a web site and put in vb 6 form
do u know how to put a control ?
Amahdy at 2007-11-11 17:26:22 >

# 5 Re: how to retrive text from a web site and put in vb 6 form
no clue any tutorial I am willing to read and learn
# 6 Re: how to retrive text from a web site and put in vb 6 form
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 .
Amahdy at 2007-11-11 17:28:19 >

# 7 Re: how to retrive text from a web site and put in vb 6 form
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
# 8 Re: how to retrive text from a web site and put in vb 6 form
Amahdy can I email you if you dont mind my friend
# 9 Re: how to retrive text from a web site and put in vb 6 form
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 ?
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 ..
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 .
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 :)
Amahdy at 2007-11-11 17:31:26 >

# 10 Re: how to retrive text from a web site and put in vb 6 form
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 .
Amahdy at 2007-11-11 17:32:26 >

# 11 Re: how to retrive text from a web site and put in vb 6 form
"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.
# 12 Re: how to retrive text from a web site and put in vb 6 form
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 .
Amahdy at 2007-11-11 17:34:30 >

# 13 Re: how to retrive text from a web site and put in vb 6 form
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 <???
# 14 Re: how to retrive text from a web site and put in vb 6 form
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
# 15 Re: how to retrive text from a web site and put in vb 6 form
I can't understand this code but genrally InStr() take 3 parameter to search a string into another :
InStr(Start, String_to_search_in_it, String_to_be_searched)
Amahdy at 2007-11-11 17:37:26 >

# 16 Re: how to retrive text from a web site and put in vb 6 form
Public Function LookFor32HexBytes(ByVal temp As String, ByVal LookFor As String, ByVal Provider As String)
Dim KeepGoing As Boolean
Dim IgnoreIt As Boolean
'Text2.Text = temp 'For debugging Website pages
Select Case LookFor
Case Is = "**DKEY0**"
LookFor = Dish00
Case Is = "**BKEY0**"
LookFor = Bev00
Case Is = "**DKEY0SPACES**"
LookFor = Right(AddSpacesNoCR(Dish00), 30)
Case Is = "**BKEY0SPACES**"
LookFor = Right(AddSpacesNoCR(Bev00), 30)
Case Is = "**DKEY1**"
LookFor = Dish01
Case Is = "**BKEY1**"
LookFor = Bev01
Case Is = "**DKEY1SPACES**"
LookFor = Right(AddSpacesNoCR(Dish01), 30)
Case Is = "**BKEY1SPACES**"
LookFor = Right(AddSpacesNoCR(Bev01), 30)
End Select
Select Case Provider
Case Is = "**DKEY0**"
Provider = Dish00
Case Is = "**BKEY0**"
Provider = Bev00
Case Is = "**DKEY0SPACES**"
Provider = Right(AddSpacesNoCR(Dish00), 30)
Case Is = "**BKEY0SPACES**"
Provider = Right(AddSpacesNoCR(Bev00), 30)
Case Is = "**DKEY1**"
Provider = Dish01
Case Is = "**BKEY1**"
Provider = Bev01
Case Is = "**DKEY1SPACES**"
Provider = Right(AddSpacesNoCR(Dish01), 30)
Case Is = "**BKEY1SPACES**"
Provider = Right(AddSpacesNoCR(Bev01), 30)
End Select
If InStr(temp, Provider) > 0 Then
If InStr(temp, LookFor) > 0 Then
temp = Right$(temp, Len(temp) - InStr(temp, Provider) + 1)
temp = Right$(temp, Len(temp) - InStr(temp, LookFor) - Len(LookFor) + 1)
KeyGet = ""
If Len(temp) < 300 Then
SrchLength = Len(temp)
Else
SrchLength = 900
End If
For x = 1 To SrchLength 'Len(temp)
IgnoreIt = 0
'STR1 = Mid$(temp, X, 32) 'debug stuff
'T = Asc(Mid$(temp, X, 1)) 'debug stuff
Form1.Caption = frmCaption + " Got the info now looking for keys " + Str$(x)
Select Case Asc(Mid$(temp, x, 1))
Case Is < 33
IgnoreIt = 1
KeepGoing = 1
Case 48 ' 0
KeepGoing = 1
Case 49 ' 1
KeepGoing = 1
Case 50 ' 2
KeepGoing = 1
Case 51 ' 3
KeepGoing = 1
Case 52 ' 4
KeepGoing = 1
Case 53 ' 5
KeepGoing = 1
Case 54 ' 6
KeepGoing = 1
Case 55 ' 7
KeepGoing = 1
Case 56 ' 8
KeepGoing = 1
Case 57 ' 9
KeepGoing = 1
Case 60 ' <
IgnoreIt = 1
KeepGoing = 1
InTag = 1
If Len(KeyGet) = 1 Then
KeyGet = ""
End If
Case 62 ' >
IgnoreIt = 1
KeepGoing = 1
InTag = 0
Case 65 ' A
KeepGoing = 1
Case 66 ' B
KeepGoing = 1
Case 67 ' C
KeepGoing = 1
Case 68 ' D
KeepGoing = 1
Case 69 ' E
KeepGoing = 1
Case 70 ' F
KeepGoing = 1
Case 79
KeepGoing = 1
Mid$(temp, x, 1) = "0"
a = Mid$(temp, x, 1)
Case 97 ' a
KeepGoing = 1
Case 98 ' b
KeepGoing = 1
Case 99 ' c
KeepGoing = 1
Case 100 ' d
KeepGoing = 1
Case 101 ' e
KeepGoing = 1
Case 102 ' f
KeepGoing = 1
Case 111
KeepGoing = 1
Mid$(temp, x, 1) = "0"
a = Mid$(temp, x, 1)
Case Is > 127
IgnoreIt = 1
KeepGoing = 1
Case Else
KeepGoing = 0
End Select
If KeepGoing Then
If IgnoreIt = 0 And InTag = 0 Then
KeyGet = KeyGet + UCase(Mid$(temp, x, 1))
End If
ElseIf InTag = 0 Then
KeyGet = ""
End If
If Len(KeyGet) = 32 Then
'We found first key.
LookFor32HexBytes = KeyGet
Form1.Caption = frmCaption
Exit Function
End If
Next
Else
LookFor32HexBytes = "Could not find key"
End If
Else
LookFor32HexBytes = "Could not find key"
End If
Form1.Caption = frmCaption
End Function What about this code? If i put this will this do the jobof searching and putting keys in text boxesi made on the form
# 17 Re: how to retrive text from a web site and put in vb 6 form
Is their any way I can decompile vb app which I only have exe. So i can get source of it and modify to my need
# 18 Re: how to retrive text from a web site and put in vb 6 form
you cant get the source only resources . or many methods to get dissasembled progs .[very difficult to go throw it after dissasembling it] !
Amahdy at 2007-11-11 17:40:31 >
