473,387 Members | 3,781 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Create and launch html page?

From within a Windows form, I need create a html page and open it within
Internet Explorer. Does anyone know whether this is possible within a
Windows Forms application? If so, please provide an example.

Thanks in advance,

Mervin Williams
Oct 28 '05 #1
8 1881
Mervin,

If it is only opening it and the extention is Html

\\\Internet Explorer C#
System.Diagnostics.Process p =
new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo pi =
new System.Diagnostics.ProcessStartInfo();
pi.FileName = "http://www.google.com";
p.StartInfo = pi;
p.Start();
///

I hope this helps,

Cor

"Mervin Williams" <mw*******@innovasolutions.net> schreef in bericht
news:um**************@TK2MSFTNGP12.phx.gbl...
From within a Windows form, I need create a html page and open it within
Internet Explorer. Does anyone know whether this is possible within a
Windows Forms application? If so, please provide an example.

Thanks in advance,

Mervin Williams

Oct 28 '05 #2
oIE = CreateObject("InternetExplorer.Application")
oIE.Navigate("about:blank")
oIE.ToolBar = True
oIE.MenuBar = False
oIE.AddressBar = False
oIE.StatusBar = False
oIE.Visible = True
oIE.Document.Title = "bla bla bla"
oIE.Document.Body.InnerHTML = "This Page Generated on the
Fly<br>bla bla bla..."
--
Uncle Sam
"Cor Ligthert [MVP]" wrote:
Mervin,

If it is only opening it and the extention is Html

\\\Internet Explorer C#
System.Diagnostics.Process p =
new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo pi =
new System.Diagnostics.ProcessStartInfo();
pi.FileName = "http://www.google.com";
p.StartInfo = pi;
p.Start();
///

I hope this helps,

Cor

"Mervin Williams" <mw*******@innovasolutions.net> schreef in bericht
news:um**************@TK2MSFTNGP12.phx.gbl...
From within a Windows form, I need create a html page and open it within
Internet Explorer. Does anyone know whether this is possible within a
Windows Forms application? If so, please provide an example.

Thanks in advance,

Mervin Williams


Oct 28 '05 #3
"Mervin Williams" <mw*******@innovasolutions.net> schrieb:
From within a Windows form, I need create a html page and open it within
Internet Explorer. Does anyone know whether this is possible within a
Windows Forms application?


Opening files, applications, Web documents, and the mail client
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=openfileappwebpage&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Oct 28 '05 #4
Just another method I'm listing here. You can just shell off Internet
Explorer from your app. (VB .NET only)

Shell("iexplore.exe http://www.google.com")

There are also some other arguments to the Shell method which you can
just lookup in the help (MSDN library) if you want to use them (Window
Style, Wait for the application to finish, and timeout). They are all
optional though. If you want to just launch it and let it go, then
just do the line of code above.

Derek Woo

Oct 28 '05 #5
Is there a corresponding CreateObject(string) method in C#?

Mervin Williams

"Uncle Sam" <Un******@discussions.microsoft.com> wrote in message
news:8B**********************************@microsof t.com...
oIE = CreateObject("InternetExplorer.Application")
oIE.Navigate("about:blank")
oIE.ToolBar = True
oIE.MenuBar = False
oIE.AddressBar = False
oIE.StatusBar = False
oIE.Visible = True
oIE.Document.Title = "bla bla bla"
oIE.Document.Body.InnerHTML = "This Page Generated on the
Fly<br>bla bla bla..."
--
Uncle Sam
"Cor Ligthert [MVP]" wrote:
Mervin,

If it is only opening it and the extention is Html

\\\Internet Explorer C#
System.Diagnostics.Process p =
new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo pi =
new System.Diagnostics.ProcessStartInfo();
pi.FileName = "http://www.google.com";
p.StartInfo = pi;
p.Start();
///

I hope this helps,

Cor

"Mervin Williams" <mw*******@innovasolutions.net> schreef in bericht
news:um**************@TK2MSFTNGP12.phx.gbl...
> From within a Windows form, I need create a html page and open it
> within
> Internet Explorer. Does anyone know whether this is possible within a
> Windows Forms application? If so, please provide an example.
>
> Thanks in advance,
>
> Mervin Williams
>


Oct 28 '05 #6
Are you trying to contruct the html for the page yourself, then push the in
memory html into the browser? You can host the webbrowser control in your
application if so:

Add the webbrowser control from the designer and give it a name. In the
below example, I have "wb_unifiedReport"

private AxSHDocVw.AxWebBrowser wb_unifiedReport;

then to initialize, you must first navigate to some page to force mshtml to
load so oyou can use the dom and set your own text. (Alternatively, if you
just want to navigate to a page, just put the url below instead of
about:blank.

// Prepare the webbrowser control for use (forces load of mshtml)
object o = null;

wb_unifiedReport.Navigate("about:blank", ref o, ref o, ref o, ref o);

Now to set your own text

BrowserProxy.SetBrowserInnerHTML( wb_unifiedReport, strHTML );

This is a custom class of mine, but here is the code for the method:

public static void SetBrowserHTML( AxSHDocVw.AxWebBrowser browser, string
strHTML )

{

//string url = "about:blank";

//object o = null;//System.Reflection.Missing.Value;

//browser.Navigate ( url,ref o,ref o,ref o,ref o);

object[] psa = {strHTML};

MSHTML.IHTMLDocument2 hDoc2 = (MSHTML.IHTMLDocument2)(browser.Document);

hDoc2.clear();

hDoc2.write(psa);

hDoc2.close();

}

Now you can create your own web documents in memory and push into a hosted
web browser control.

-David

"Mervin Williams" <mw*******@innovasolutions.net> wrote in message
news:um**************@TK2MSFTNGP12.phx.gbl...
From within a Windows form, I need create a html page and open it within
Internet Explorer. Does anyone know whether this is possible within a
Windows Forms application? If so, please provide an example.

Thanks in advance,

Mervin Williams

Oct 29 '05 #7
object oIE = null;
oIE = Interaction.CreateObject( "InternetExplorer.Application", "" );
--
Uncle Sam
"Mervin Williams" wrote:
Is there a corresponding CreateObject(string) method in C#?

Mervin Williams

"Uncle Sam" <Un******@discussions.microsoft.com> wrote in message
news:8B**********************************@microsof t.com...
oIE = CreateObject("InternetExplorer.Application")
oIE.Navigate("about:blank")
oIE.ToolBar = True
oIE.MenuBar = False
oIE.AddressBar = False
oIE.StatusBar = False
oIE.Visible = True
oIE.Document.Title = "bla bla bla"
oIE.Document.Body.InnerHTML = "This Page Generated on the
Fly<br>bla bla bla..."
--
Uncle Sam
"Cor Ligthert [MVP]" wrote:
Mervin,

If it is only opening it and the extention is Html

\\\Internet Explorer C#
System.Diagnostics.Process p =
new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo pi =
new System.Diagnostics.ProcessStartInfo();
pi.FileName = "http://www.google.com";
p.StartInfo = pi;
p.Start();
///

I hope this helps,

Cor

"Mervin Williams" <mw*******@innovasolutions.net> schreef in bericht
news:um**************@TK2MSFTNGP12.phx.gbl...
> From within a Windows form, I need create a html page and open it
> within
> Internet Explorer. Does anyone know whether this is possible within a
> Windows Forms application? If so, please provide an example.
>
> Thanks in advance,
>
> Mervin Williams
>


Oct 30 '05 #8
Mervin Williams wrote:
From within a Windows form, I need create a html page and open it within
Internet Explorer. Does anyone know whether this is possible within a
Windows Forms application? If so, please provide an example.


save the file to the filesystem in a temp location, and use
Process.Start("iexplore.exe", "file://X:/.../filename.ext")
should be similar to that.. (off the top of my head).

--
Michael J. Ryan - tracker1(at)theroughnecks(dot)net - www.theroughnecks.net
icq: 4935386 - AIM/AOL: azTracker1 - Y!: azTracker1 - MSN/Win: (email)
Nov 2 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Nico | last post by:
I try to execute a shell command from ASP with: response.write("start") Set wshShell = CreateObject("WScript.Shell") wshShell.Run "notepad" Set wshShell = Nothing response.write("finished") ...
7
by: dan glenn | last post by:
I want to use some javascript to launch a windows application (this used on intranet) but don't know how. Can anyone help me out please? It'd be neat if I could not only launch the application...
4
by: Caroline | last post by:
I'd like to launch an executable file from a web page. Basically, the user enters seven parameters and then clicks a button to generate a graph. The input is written to a file and then read by...
8
by: Mervin Williams | last post by:
From within a Windows form, I need create a html page and open it within Internet Explorer. Does anyone know whether this is possible within a Windows Forms application? If so, please provide an...
0
by: spamfurnace | last post by:
Hi there on this rainy old day, I have some users logging into an asp.net website. The server the site sits on allows users to webmail through a common service/component called Horde. In order...
4
by: J | last post by:
hi, all, I have an asp.net page which let user view data from database (using dataset), but now, how can I create a CSV file in asp.net then let user save to their local machine? Thanks in...
1
by: Larry Rebich | last post by:
How do I launch the default e-mail agent using Asp.Net 2.0 and VB 2005? I have a button on the page called 'Send e-Mail'. I want to launch the user's default e-mail agent. The message will...
1
by: Ernest | last post by:
Trying to launch my flash videos by passing their URL listed in a field on MYSQL via PHP script. Any help is greatly appreciated. 1) I am able to launch the video referenced directly in main...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.