• Log in or sign up for an account here: https://www.sythe.org/login

Serious Help needed

  • Thread starter Thread starter GuiderGuy
  • Start date Start date
G

GuiderGuy

Guest
Hello.

I'm having this 5 megabytes HTML file. My need is to create it from within the program, then, display it in the webbrowser control.

Dim sFileText As String
Dim iFileNo As Integer
iFileNo = FreeFile
Open "LIST.html" For Output As #iFileNo
Print #iFileNo, Text1.Text
Close #iFileNo

Text1.text should have the entire source of the HTML file in it.
I copied down the entire source of the HTML, tried pasting it in, but it only pasted like 10 lines, which aren't even 1/1000000 of the entire source.

I then tried thinking how could I make it write down the html from within the file:
Print #iFileNo,"blabla"

is usless since my html file has " in it, thus breaking the code.

My question is, is there any-way I can let my program create the 5 megabytes html file (well, writing the source down to the file basiclly)?

It must be done via the program ONLY (no inet's, stuff like that .. Pure executable)

Thanks.
 
Code:
Function Save_HTML(HTML As String)
Dim iFileNo As Integer
      iFileNo = FreeFile
      Open "LIST.html" For Output As #iFileNo
            Print #iFileNo, HTML
      Close #iFileNo
End Function

Function Write_HTML(HTML As String)
      WebBrowser1.Navigate "about:blank"
      WebBrowser1.Document.write HTML
End Function



Code:
      Call Save_HTML(Text1.Text)
      Call Write_HTML(Text1.Text)
 
Code:
Function Save_HTML(HTML As String)
Dim iFileNo As Integer
      iFileNo = FreeFile
      Open "LIST.html" For Output As #iFileNo
            Print #iFileNo, HTML
      Close #iFileNo
End Function

Function Write_HTML(HTML As String)
      WebBrowser1.Navigate "about:blank"
      WebBrowser1.Document.write HTML
End Function



Code:
      Call Save_HTML(Text1.Text)
      Call Write_HTML(Text1.Text)

Thanks alot, but i'm not sure what am I susposed to do with this code.
Let me explain myself: I was not able to paste the entire 10,000 lines of html-source code, into the Text-Box's Text property ... :/ I'm not entirely sure how can the following code assist ...?

Please note, running the code generates an "Object required" error here:

Function Write_HTML(HTML As String)
WebBrowser1.Navigate "about:blank"
WebBrowser1.Document.write HTML
End Function
 
OK, so I'm assuming you have your *.html file already on your computer. Copy coveys loadfile code from here
http://www.sythe.org/showpost.php?p=2659193&postcount=88

and load your html file straight into the webbrowser

Call Write_HTML(LoadFile(App.Path & "\afilehere.html"))

Your getting the "object requred" message because you
A ) do not have a webbrowser control
B ) have it named something other then "WebBrowser1"
 
Thank you very much for replying, but I believe I did not explain myself.

What I want to happen, is that the executable will CREATE the HTML file on the user's computer, the user never had that particular HTML file before. I was trying to achieve that by writing an HTML file with the contents of a Textbox, but alas, I was not able to fill the entire HTML-code into the text box ...
 
Well then either hardcode that 5Mb file into a string in vb (i dont think i string could hold that many characters though), or upload it somewhere and have it download and then write the file to the users computer.
 
I already figured out how to do this, I just used a Resource file ...! :D
 
Runescape Gamblingrunescape gambling
Back
Top