| | |
I could use some help!
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Sep 2008
Posts: 36
Reputation:
Solved Threads: 0
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,
Thanks in Advance,
Last edited by Alexpap; Dec 28th, 2008 at 12:33 pm. Reason: Clear Reading issues
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
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
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:
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:
VB.NET Syntax (Toggle Plain Text)
Imports System.Text Imports System.IO Dim MemStream As MemoryStream Dim ByteArr() As Byte Dim Page As String Page = "" Page = Page & "<html>" Page = Page & "<head>" Page = Page & "<title>MemoryStream</title>" Page = Page & "</head>" Page = Page & "<body>" Page = Page & "Hello Net!" Page = Page & "</body>" Page = Page & "<html>" ByteArr = Encoding.Default.GetBytes(Page) MemStream = New MemoryStream(ByteArr) WebBrowser1.DocumentStream = MemStream
Teme64 @ Windows Developer Blog
•
•
Join Date: Sep 2008
Posts: 36
Reputation:
Solved Threads: 0
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:
Where the wbrPreview is the .NET Web Browser and the txtHTML.text is the textbox wich contains the HMTL.
here's the code im trying to use:
VB.Net Syntax (Toggle Plain Text)
wbrPreview.DocumentText = txtHTML.Text
Where the wbrPreview is the .NET Web Browser and the txtHTML.text is the textbox wich contains the HMTL.
You can save it into file .html\htm then call
vb.net Syntax (Toggle Plain Text)
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
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
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
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
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
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Hi Alexpap! See my #3 post how to use webbrowser control.
Your code should be following:
This works for me.
Your code should be following:
VB.NET Syntax (Toggle Plain Text)
Imports System.Text Imports System.IO Dim MemStream As MemoryStream Dim ByteArr() As Byte ByteArr = Encoding.Default.GetBytes(txtHTML.Text) MemStream = New MemoryStream(ByteArr) wbrPreview.DocumentStream = MemStream
Teme64 @ Windows Developer Blog
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: related to save dialogbox
- Next Thread: context menu and print preview problem
| Thread Tools | Search this Thread |
"crystal .net .net2005 .net2008 2008 access add application array assignment basic beginner box browser button buttons click code combo convert cpu cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationthesis dissertationtopic dosconsolevb.net editvb.net exists fade filter firewall forms html image images input isnumericfuntioncall listview math mobile module mssqlbackend mysql navigate number opacity open panel picturebox picturebox2 port print printing printpreview record regex reports" reuse right-to-left savedialog serial settings shutdown socket sqldatbase sqlserver storedprocedure string temp temperature textbox timer timespan transparency txttoxmlconverter useraccounts usercontol usercontrol vb vb.net vb.nettoolboxvisualbasic2008sidebar vbnet vista visual visualbasic.net visualstudio.net web winforms wpf wrapingcode xml year






