Solved

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

Posted on 2013-12-30
3
999 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Telerik RadEditor Control Save 8 39
.Net remove carriage returns, line feeds and tabbs 5 36
vb.net code 9 28
Difference between Highcharts and Mapbox 10 44
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…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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