PC Review


Reply
Thread Tools Rate Thread

Create and launch html page?

 
 
Mervin Williams
Guest
Posts: n/a
 
      28th Oct 2005
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


 
Reply With Quote
 
 
 
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      28th Oct 2005
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" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
=?Utf-8?B?VW5jbGUgU2Ft?=
Guest
Posts: n/a
 
      28th Oct 2005
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" <(E-Mail Removed)> schreef in bericht
> news:(E-Mail Removed)...
> > 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
> >

>
>
>

 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      28th Oct 2005
"Mervin Williams" <(E-Mail Removed)> 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/>
 
Reply With Quote
 
wooster11
Guest
Posts: n/a
 
      28th Oct 2005
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

 
Reply With Quote
 
Mervin Williams
Guest
Posts: n/a
 
      28th Oct 2005
Is there a corresponding CreateObject(string) method in C#?

Mervin Williams

"Uncle Sam" <(E-Mail Removed)> wrote in message
news:8B225621-209C-4027-A430-(E-Mail Removed)...
> 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" <(E-Mail Removed)> schreef in bericht
>> news:(E-Mail Removed)...
>> > 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
>> >

>>
>>
>>



 
Reply With Quote
 
David
Guest
Posts: n/a
 
      29th Oct 2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
=?Utf-8?B?VW5jbGUgU2Ft?=
Guest
Posts: n/a
 
      30th Oct 2005
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" <(E-Mail Removed)> wrote in message
> news:8B225621-209C-4027-A430-(E-Mail Removed)...
> > 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" <(E-Mail Removed)> schreef in bericht
> >> news:(E-Mail Removed)...
> >> > 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
> >> >
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Michael J. Ryan (tracker1)
Guest
Posts: n/a
 
      2nd Nov 2005
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)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you create a response page with no HTML in ASP.Net? wptpro@gmail.com Microsoft ASP .NET 5 18th Nov 2005 06:25 PM
Create and launch html page? Mervin Williams Microsoft Dot NET Framework Forms 8 2nd Nov 2005 07:25 AM
Create and launch html page? Mervin Williams Microsoft Dot NET 8 2nd Nov 2005 07:25 AM
Create and launch html page? Mervin Williams Microsoft C# .NET 8 2nd Nov 2005 07:25 AM
how to create a mail from html page... NetPointer Microsoft Outlook 1 22nd Oct 2003 05:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:03 PM.