Solved

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

Posted on 2013-12-30
3
854 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now