Serious Help needed

Discussion in 'Programming General' started by GuiderGuy, Dec 6, 2007.

Serious Help needed
  1. Unread #1 - Dec 6, 2007 at 7:03 AM
  2. GuiderGuy
    Referrals:
    0

    GuiderGuy Guest

    Serious Help needed

    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.

    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:
    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.
     
  3. Unread #2 - Dec 6, 2007 at 8:21 AM
  4. Jazz00006
    Joined:
    Aug 26, 2005
    Posts:
    807
    Referrals:
    0
    Sythe Gold:
    0

    Jazz00006 Apprentice
    Visual Basic Programmers

    Serious Help needed

    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)
     
  5. Unread #3 - Dec 6, 2007 at 8:49 AM
  6. GuiderGuy
    Referrals:
    0

    GuiderGuy Guest

    Serious Help needed

    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:

     
  7. Unread #4 - Dec 6, 2007 at 9:42 AM
  8. Jazz00006
    Joined:
    Aug 26, 2005
    Posts:
    807
    Referrals:
    0
    Sythe Gold:
    0

    Jazz00006 Apprentice
    Visual Basic Programmers

    Serious Help needed

    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"
     
  9. Unread #5 - Dec 7, 2007 at 2:39 AM
  10. GuiderGuy
    Referrals:
    0

    GuiderGuy Guest

    Serious Help needed

    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 ...
     
  11. Unread #6 - Dec 7, 2007 at 4:53 AM
  12. Covey
    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Serious Help needed

    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.
     
  13. Unread #7 - Dec 7, 2007 at 6:07 AM
  14. GuiderGuy
    Referrals:
    0

    GuiderGuy Guest

    Serious Help needed

    I already figured out how to do this, I just used a Resource file ...! :D
     
< beep() in vb8? | [Source + DLL] Hiscores Usercontrol >

Users viewing this thread
1 guest


 
 
Adblock breaks this site