Solved

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

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

821 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