Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-12-30
3
Medium Priority
?
1,076 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:Hiran Desai
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:
Hiran Desai earned 2000 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

705 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