473,699 Members | 2,564 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Nov 17 '05 #1
8 6496
Mervin,

If it is only opening it and the extention is Html

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

I hope this helps,

Cor

"Mervin Williams" <mw*******@inno vasolutions.net > schreef in bericht
news:um******** ******@TK2MSFTN GP12.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

Nov 17 '05 #2
oIE = CreateObject("I nternetExplorer .Application")
oIE.Navigate("a bout:blank")
oIE.ToolBar = True
oIE.MenuBar = False
oIE.AddressBar = False
oIE.StatusBar = False
oIE.Visible = True
oIE.Document.Ti tle = "bla bla bla"
oIE.Document.Bo dy.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.Diagnost ics.Process p =
new System.Diagnost ics.Process();
System.Diagnost ics.ProcessStar tInfo pi =
new System.Diagnost ics.ProcessStar tInfo();
pi.FileName = "http://www.google.com" ;
p.StartInfo = pi;
p.Start();
///

I hope this helps,

Cor

"Mervin Williams" <mw*******@inno vasolutions.net > schreef in bericht
news:um******** ******@TK2MSFTN GP12.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


Nov 17 '05 #3
"Mervin Williams" <mw*******@inno vasolutions.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=openfileapp webpage&lang=en >

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 17 '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

Nov 17 '05 #5
Is there a corresponding CreateObject(st ring) method in C#?

Mervin Williams

"Uncle Sam" <Un******@discu ssions.microsof t.com> wrote in message
news:8B******** *************** ***********@mic rosoft.com...
oIE = CreateObject("I nternetExplorer .Application")
oIE.Navigate("a bout:blank")
oIE.ToolBar = True
oIE.MenuBar = False
oIE.AddressBar = False
oIE.StatusBar = False
oIE.Visible = True
oIE.Document.Ti tle = "bla bla bla"
oIE.Document.Bo dy.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.Diagnost ics.Process p =
new System.Diagnost ics.Process();
System.Diagnost ics.ProcessStar tInfo pi =
new System.Diagnost ics.ProcessStar tInfo();
pi.FileName = "http://www.google.com" ;
p.StartInfo = pi;
p.Start();
///

I hope this helps,

Cor

"Mervin Williams" <mw*******@inno vasolutions.net > schreef in bericht
news:um******** ******@TK2MSFTN GP12.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
>


Nov 17 '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_unifiedRepo rt"

private AxSHDocVw.AxWeb Browser wb_unifiedRepor t;

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_unifiedRepor t.Navigate("abo ut:blank", ref o, ref o, ref o, ref o);

Now to set your own text

BrowserProxy.Se tBrowserInnerHT ML( wb_unifiedRepor t, strHTML );

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

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

{

//string url = "about:blan k";

//object o = null;//System.Reflecti on.Missing.Valu e;

//browser.Navigat e ( url,ref o,ref o,ref o,ref o);

object[] psa = {strHTML};

MSHTML.IHTMLDoc ument2 hDoc2 = (MSHTML.IHTMLDo cument2)(browse r.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*******@inno vasolutions.net > wrote in message
news:um******** ******@TK2MSFTN GP12.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

Nov 17 '05 #7
object oIE = null;
oIE = Interaction.Cre ateObject( "InternetExplor er.Application" , "" );
--
Uncle Sam
"Mervin Williams" wrote:
Is there a corresponding CreateObject(st ring) method in C#?

Mervin Williams

"Uncle Sam" <Un******@discu ssions.microsof t.com> wrote in message
news:8B******** *************** ***********@mic rosoft.com...
oIE = CreateObject("I nternetExplorer .Application")
oIE.Navigate("a bout:blank")
oIE.ToolBar = True
oIE.MenuBar = False
oIE.AddressBar = False
oIE.StatusBar = False
oIE.Visible = True
oIE.Document.Ti tle = "bla bla bla"
oIE.Document.Bo dy.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.Diagnost ics.Process p =
new System.Diagnost ics.Process();
System.Diagnost ics.ProcessStar tInfo pi =
new System.Diagnost ics.ProcessStar tInfo();
pi.FileName = "http://www.google.com" ;
p.StartInfo = pi;
p.Start();
///

I hope this helps,

Cor

"Mervin Williams" <mw*******@inno vasolutions.net > schreef in bericht
news:um******** ******@TK2MSFTN GP12.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
>


Nov 17 '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)the roughnecks(dot) net - www.theroughnecks.net
icq: 4935386 - AIM/AOL: azTracker1 - Y!: azTracker1 - MSN/Win: (email)
Nov 17 '05 #9

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

Similar topics

3
6555
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") but it doesn't work, there is no error message, the page just displays nothing. I tried various commands like "mkdir test" or calling a batch
7
30952
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 but minimize the webpage's browser at the same time, but this is just icing on the cake... -dg
4
5199
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 the exe. The exe then generates a graph based upon the input parameters. I am reading about the Process class and wondering if that is the best approach to this. Can you recommend a KB article?
8
1896
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 example. Thanks in advance, Mervin Williams
0
1821
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 to log onto Horde webmail the users have to fill in 5 fields. I wanted to simplify things for them so they only had to click a button once logged into the aps.net site. At the moment i do this by recreating the form on my webform making all the...
4
2220
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 advance. J.
1
1369
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 contain a send to address, subject and text. No attachments will be sent. Thanks,
1
1968
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 page...for example: launch_video.php printf("Movie %s: <a href='http://.../embedded_flash_video.html'>%s</a> and 2) I can print the URL as output from server via PHP script...for example: launch_video.php printf("Movie %s: <a...
15
5269
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 show - text boxes, input boxes, buttons, hyperlinks ie the usual. The data is not obtained directly from a database.
0
8691
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8887
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6536
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4633
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3060
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2351
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2012
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.