PDA

Click to See Complete Forum and Search --> : I cant store all of my info in a text box, what else


Jan 14th, 2000, 03:40 AM
I am trying to get the html source code of a webpage and put it in a text box. The problem is the text box doesn't hold it all. It gets cut off. Anyone know how to either get all of the info into a spot where i can search through it all or how to take chunks of the source code off of the webpage?

netSurfer
Jan 14th, 2000, 03:44 AM
As far I remember, a normal text box only holds 255 chars, this is probably the problem you're having.

Jan 14th, 2000, 03:49 AM
then how can i get around this problem?
I am using:
Text1.Text=Inet1.OpenURL("mywebsite.com")
to get the source code is there a way to either write the code to a file directly so i get it all or is there a way extract it by parts from the web page source code?

Jan 14th, 2000, 03:49 AM
actually a textbox holds i believe up to 65k but with html source this can be exceeded quickly. make sure you set the multiline property equal to true(then set the scrollbars so you can scroll, I would used the Rich Text Box though as it holds WAY more than the textbox control and it's default is multiline = true.

Jan 14th, 2000, 03:51 AM
actually i think when i used a rtb it held less. i think.

Jan 14th, 2000, 03:59 AM
i need it to hold about 37 kb worth of source code, and i retract my last statement about the rtb

ChrisJackson
Jan 14th, 2000, 04:14 AM
Hi dmartin17,

I found this in MSDN Help in VB. I haven't tried it, but it should work. It writes the source code to a text file:
Dim strURL As String ' URL string
Dim intFile As Integer ' FreeFile variable
IntFile = FreeFile()
strURL = "http://www.microsoft.com"
Open "c:\temp\MSsource.txt" For Output _
As #IntFile
Write #IntFile, Inet1.OpenURL(strURL)
Close #IntFile

HTH.

Chris

[This message has been edited by ChrisJackson (edited 01-14-2000).]

Jan 14th, 2000, 07:21 AM
ok ive tried writing directly to a file ive also tried using a rich text box and a regular text box. the bottem line is that it never gets the entire amount of source code, it always stops before finishing.

any other suggestions on was to get the source code? I need to search through it for specific words and numbers? please let me know

Jan 14th, 2000, 07:23 AM
ok ive tried writing directly to a file ive also tried using a rich text box and a regular text box. the bottem line is that it never gets the entire amount of source code, it always stops before finishing.

any other suggestions on was to get the source code? I need to search through it for specific words and numbers? please let me know

XxEvilxX
Jan 14th, 2000, 09:42 PM
i got a ideal make it where it saves to it own file like something.web cuase usaly that might make it be bigger try it and see

Jan 14th, 2000, 10:58 PM
hi,

i had the same problem. i think u use the MSINET ocx, right ?

Jan 15th, 2000, 02:01 AM
Ive tried all of these thigns but for some reason i can not get all of the text. Thanks for the help. i still just cant get it to work.

Clunietp
Jan 15th, 2000, 11:33 AM
from MSDN:

the RichTextBox control doesn't have the same 64K character capacity limit of the conventional TextBox control.

Jan 16th, 2000, 08:26 PM
I still have had no success with this anymore ideas?

HarryW
Jan 16th, 2000, 08:39 PM
Hi.

I'm no expert on this, but you did say ANY more ideas, so here's one. I have absolutely no idea if it's a good one though.

Maybe you could output the HTML to the clipboard? I don't think I've ever had text cut off from pasting, but then I probably never exceeded the 65k mark :) I dunno, but you might want to try it.

For the purposes of identifying the reason for the cut-off: how much text can you carry over? Is it always the same? Maybe the problem is not the way you're outputting the text, maybe it's the way you're retrieving it in the first place.

I have no experience in this area, so I don't really know enough to make any suggestions.