473,748 Members | 10,569 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 6497
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
6557
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
30954
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
5203
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
1898
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
1824
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
2223
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
1374
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
1971
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
5276
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
8831
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9548
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
9374
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9325
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6796
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
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
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
3
2215
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.