| | |
I could use some help!
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
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 30minutes 2005 2008 access arithmetic array assignment basic binary bing box button buttons center check code combobox component connectionstring convert cpu crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist editvb.net employees excel file-dialog firewall folder ftp google hardcopy image images isnumericfuntioncall login math memory mobile ms mssqlbackend mysql navigate net networking opacity output peertopeervideostreaming picturebox1 port printpreview problemwithinstallation project record reports" reuse save savedialog searchbox serial soap storedprocedure string tcp temp text textbox timer toolbox trim updown useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view vista visual visualbasic visualbasic.net visualstudio web wpf






