Solved

How to load an HTML resource into the default web browser from VB.NET

Posted on 2013-12-30
3
945 Views
Last Modified: 2013-12-31
Hello, I'm writing a not-that-formal VB.NET forms application and am creating some documentation in an HTML file.  I notice that I can incorporate the Help.HTML file into the project as a resource (add resource -> add existing file).  By far the simplest way to deploy this help file along with the program (I generally just give people the EXE, do not use an installer) is to put a "view help" item on the main menu and to open the HTML file resource in a browser.

However, I've been googling around and been unable to find the commands to do this.  Is this possible?

Thanks for the help.
0
Comment
Question by:RonMexico
  • 2
3 Comments
 
LVL 4

Expert Comment

by:ItWorked
ID: 39747655
Yes it's possible.
Understanding your problem what you are trying to achieve is You want to show help to user in your Windows application project. ( I guess this is what you want to be done).

1. Firs you gonna use WebBroser control of WinForm.
2. create your Help.html file and save it to your output directory.( I'll keep it at place from where I can get it easy)
3. Read content of File with System.IO.File.ReadAllLines/ReadAllText
4. You can check WebBrowser Class at WebBrowser Control Class and Most probably you can assign your HTML(which is as string) to control's
DocumentText

Open in new window

property.

Let me know if this doesn't work.

Forgot to keep in mind about resources,

You can check this for coping you HTML file to Ouput directory.
Get Resource  HTML file
0
 

Author Comment

by:RonMexico
ID: 39747795
ItWorked, what I would like to do is open an external browser, whatever browser they have installed (eg whatever opens when they click on an .html file).  

Won't that open it up into a control on my form?  That's not quite what I want to do.
0
 
LVL 4

Accepted Solution

by:
ItWorked earned 500 total points
ID: 39747937
aha...got it worng but anyway you can do it by using Process class.

System.Diagnostics.Process p=new System.Diagnostics.Process("Anything");

Open in new window


where "Anything"  needs to be path of your HTML file. if it's in local computer then that may be like D:\myfolder\myfile.html

and if it's on live server then that needs to be http://servername.domain/yourhtmlfile.html

hope this will work ;-)
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question