I could use some help!

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2008
Posts: 36
Reputation: Alexpap is an unknown quantity at this point 
Solved Threads: 0
Alexpap Alexpap is offline Offline
Light Poster

I could use some help!

 
0
  #1
Dec 28th, 2008
Hello All, i have an aplication to make that converts a rtf text into html and then the html code must be shown into a web browser. What can't I do is to convert the HTML Code into a html website. To make myself more clear, what i want from you guys to help me is how can i take the generated HTML code and show it to a browser without having to create an HTML File and then run the html file....


Thanks in Advance,
Last edited by Alexpap; Dec 28th, 2008 at 12:33 pm. Reason: Clear Reading issues
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: I could use some help!

 
0
  #2
Dec 28th, 2008
If you can convert text to html tags you can save these tags into text file with extension htm\html!
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 710
Reputation: Teme64 will become famous soon enough Teme64 will become famous soon enough 
Solved Threads: 114
Teme64's Avatar
Teme64 Teme64 is offline Offline
Master Poster

Re: I could use some help!

 
1
  #3
Dec 28th, 2008
Do you want to show HTML in the browser application or with .NET's web browser control?

In the first case, you'll have to save HTML code to a file. In the latter case i.e. your VB.NET application shows the page with web browser control, you do not have to create a file:
  1. Imports System.Text
  2. Imports System.IO
  3.  
  4. Dim MemStream As MemoryStream
  5. Dim ByteArr() As Byte
  6. Dim Page As String
  7. Page = ""
  8. Page = Page & "<html>"
  9. Page = Page & "<head>"
  10. Page = Page & "<title>MemoryStream</title>"
  11. Page = Page & "</head>"
  12. Page = Page & "<body>"
  13. Page = Page & "Hello Net!"
  14. Page = Page & "</body>"
  15. Page = Page & "<html>"
  16. ByteArr = Encoding.Default.GetBytes(Page)
  17. MemStream = New MemoryStream(ByteArr)
  18. WebBrowser1.DocumentStream = MemStream
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 36
Reputation: Alexpap is an unknown quantity at this point 
Solved Threads: 0
Alexpap Alexpap is offline Offline
Light Poster

Re: I could use some help!

 
0
  #4
Dec 29th, 2008
im trying to show the generated html code in the .NET web browser control, but it stucks

here's the code im trying to use:
  1. wbrPreview.DocumentText = txtHTML.Text

Where the wbrPreview is the .NET Web Browser and the txtHTML.text is the textbox wich contains the HMTL.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: I could use some help!

 
0
  #5
Dec 29th, 2008
You can save it into file .html\htm then call
  1. webbrowser.Navigate(htmlFilePath)
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 36
Reputation: Alexpap is an unknown quantity at this point 
Solved Threads: 0
Alexpap Alexpap is offline Offline
Light Poster

Re: I could use some help!

 
0
  #6
Dec 30th, 2008
but wouldnt that take a lot of memory that every time i want to preview a HTML page to save the code and then run it?
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: I could use some help!

 
0
  #7
Dec 30th, 2008
You save it into temp file on local HDD, then preview it... No great memory consumption.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 36
Reputation: Alexpap is an unknown quantity at this point 
Solved Threads: 0
Alexpap Alexpap is offline Offline
Light Poster

Re: I could use some help!

 
0
  #8
Dec 30th, 2008
ok i will try it, thanks for taking time to answer me!
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: I could use some help!

 
0
  #9
Dec 30th, 2008
You're welcome, if this thread answered, please mark it as solved.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 710
Reputation: Teme64 will become famous soon enough Teme64 will become famous soon enough 
Solved Threads: 114
Teme64's Avatar
Teme64 Teme64 is offline Offline
Master Poster

Re: I could use some help!

 
0
  #10
Jan 6th, 2009
Hi Alexpap! See my #3 post how to use webbrowser control.
Your code should be following:
  1. Imports System.Text
  2. Imports System.IO
  3.  
  4. Dim MemStream As MemoryStream
  5. Dim ByteArr() As Byte
  6. ByteArr = Encoding.Default.GetBytes(txtHTML.Text)
  7. MemStream = New MemoryStream(ByteArr)
  8. wbrPreview.DocumentStream = MemStream
This works for me.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC