473,320 Members | 1,982 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,320 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 1877
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.