473,598 Members | 3,252 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing in a file to a browser...

I am creating a small help browser. It is pretty much finished except I
cannot find how to pass a file to it (i.e. browser.exe index.html, or any
html file, and the html file opens in the browser) from the command line.

Pointers would help. : )

Bob
Nov 20 '05 #1
8 1549
Hi Robert,

Strange Herfried did not answer this one because it looks to me that you are
only asking this one

\\\
Dim psi As New ProcessStartInf o
psi.FileName = "http://www.bla.foo"
psi.UseShellExe cute = True
Process.Start(p si)
///

When you are longer on this newsgroup you recognise the typical Herfried
code.

However maybe I am wrong?

Cor
Nov 20 '05 #2
"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:eJ******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi Robert,

Strange Herfried did not answer this one because it looks to me that you are only asking this one

\\\
Dim psi As New ProcessStartInf o
psi.FileName = "http://www.bla.foo"
psi.UseShellExe cute = True
Process.Start(p si)
///

When you are longer on this newsgroup you recognise the typical Herfried
code.

However maybe I am wrong?

Cor
Thanks. That hardcodes the filename? I was looking to be able to launch any
HTML file from the command line. But it gives me a start to work from...

Nov 20 '05 #3
Robert,
Try:

Public Module MainModule
Public Sub Main(ByVal args() As String)
Dim psi As New ProcessStartInf o
psi.FileName = args(0)
psi.UseShellExe cute = True
Process.Start(p si)
End Sub
End Module

Hope this helps
Jay

"Robert" <ca*****@linuxm ail.org> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. .. "Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:eJ******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi Robert,

Strange Herfried did not answer this one because it looks to me that you are
only asking this one

\\\
Dim psi As New ProcessStartInf o
psi.FileName = "http://www.bla.foo"
psi.UseShellExe cute = True
Process.Start(p si)
///

When you are longer on this newsgroup you recognise the typical Herfried
code.

However maybe I am wrong?

Cor


Thanks. That hardcodes the filename? I was looking to be able to launch

any HTML file from the command line. But it gives me a start to work from...


Nov 20 '05 #4
Maybe I am doing something wrong so I am going to be more verbose. I need to
created a minimal browser to view some help files that are in HTML. I
created a standard Windows form and put the AxWebBrowser control on it as
well as a toolbar with "back", "forward", and "exit". I can drag and drop an
HTML file on the running application and it renders the page and I can move
back and forth with my nav buttons. I cannot (even using the snippet you
gave) pass an HTML page via the command line and have the AxWebBrowser
control display it.

Without going in to much detail. We have a 3rd party application that
currently opens IE to view its help files (which opens holes we do not want
to deal with) so I intend to "replace" IE with my little help browser and
make all the big wigs happy. And learn VB.NET is the process! : )
Nov 20 '05 #5
Hi Robert,

This seems to me a total different approach, you did something as this

Open a new windows application project

In the toolbox rightclick and select add/Remove items

In the customize toolbox select Com and in that Microsoft Webbrowser

When that is in the toolbox drag it to your form
Drag also a button to your form.

Then this code and you have a mini Webbrowser.

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Me.AxWebBrowser 1.Navigate2("ww w.google.com")
End Sub

While that www.google.com can be a textbox of course or your html file.

A very complete sample is here.

webbrowser
http://support.microsoft.com/?kbid=311303

And what more documentation.
mshtml
http://msdn.microsoft.com/library/de...ng/hosting.asp
Nov 20 '05 #6
"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:ey******** ******@tk2msftn gp13.phx.gbl...
Hi Robert,

This seems to me a total different approach, you did something as this

Open a new windows application project

In the toolbox rightclick and select add/Remove items

In the customize toolbox select Com and in that Microsoft Webbrowser

When that is in the toolbox drag it to your form
Drag also a button to your form.

Then this code and you have a mini Webbrowser.

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Me.AxWebBrowser 1.Navigate2("ww w.google.com")
End Sub

While that www.google.com can be a textbox of course or your html file.

A very complete sample is here.

webbrowser
http://support.microsoft.com/?kbid=311303

And what more documentation.
mshtml
http://msdn.microsoft.com/library/de...ng/hosting.asp

Right. Like I said I have it almost completed. It does not (and the examples
above do not) allow me to pass an HTML file from the command line. I can
drop an HTML file on the running app and that works. I would also not like
to have to hard code a path. I am new to VB.NET so maybe I am not focusing
my thoughts correctly. : )
Nov 20 '05 #7
Robert,
You did notice that my sample allowed you to pass a file from the command
line?

There are a number of methods to pass parameters to your program, I prefer
the Main(args) method

Public Sub Main(ByVal args() As String)
End Sub

If you have an embeded browser you could do something like:

Public Class MainForm
Inherits Form

Public Shared Sub Main(ByVal args() As String)
Dim mainForm As New MainForm
mainForm.AxWebB rowser1.Navigat e2(args(0))
Application.Run (mainForm)
End Sub

End Class

Alternatively you can use the VB.NET Command() function to load the browser:
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Me.AxWebBrowser 1.Navigate2(Com mand())
End Sub
Still another method would be to use either System.Environm ent.CommandLine
or System.Environm ent.GetCommandL ineArgs().
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Me.AxWebBrowser 1.Navigate2(Env ironment.Comman dLine)
End Sub
I would use Environment.Com mandLine if I wanted to parse the complete
command line myself, otherwise I would use Environment.Get CommandLineArgs ()
which seperates the command line into individual string tokens... However I
mostly use the Sub Main(args() As String) method.

Hope this helps
Jay


"Robert" <ca*****@linuxm ail.org> wrote in message
news:eA******** ******@TK2MSFTN GP10.phx.gbl...
"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:ey******** ******@tk2msftn gp13.phx.gbl...
Hi Robert,

This seems to me a total different approach, you did something as this

Open a new windows application project

In the toolbox rightclick and select add/Remove items

In the customize toolbox select Com and in that Microsoft Webbrowser

When that is in the toolbox drag it to your form
Drag also a button to your form.

Then this code and you have a mini Webbrowser.

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Me.AxWebBrowser 1.Navigate2("ww w.google.com")
End Sub

While that www.google.com can be a textbox of course or your html file.

A very complete sample is here.

webbrowser
http://support.microsoft.com/?kbid=311303

And what more documentation.
mshtml

http://msdn.microsoft.com/library/de...ng/hosting.asp

Right. Like I said I have it almost completed. It does not (and the

examples above do not) allow me to pass an HTML file from the command line. I can
drop an HTML file on the running app and that works. I would also not like
to have to hard code a path. I am new to VB.NET so maybe I am not focusing
my thoughts correctly. : )

Nov 20 '05 #8
"Jay B. Harlow [MVP - Outlook]" <Ja************ @msn.com> wrote in message
news:OX******** ******@TK2MSFTN GP09.phx.gbl...
Robert,
You did notice that my sample allowed you to pass a file from the command
line?

There are a number of methods to pass parameters to your program, I prefer
the Main(args) method

Public Sub Main(ByVal args() As String)
End Sub

If you have an embeded browser you could do something like:

Public Class MainForm
Inherits Form

Public Shared Sub Main(ByVal args() As String)
Dim mainForm As New MainForm
mainForm.AxWebB rowser1.Navigat e2(args(0))
Application.Run (mainForm)
End Sub

End Class

Alternatively you can use the VB.NET Command() function to load the browser:
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Me.AxWebBrowser 1.Navigate2(Com mand())
End Sub
Still another method would be to use either System.Environm ent.CommandLine
or System.Environm ent.GetCommandL ineArgs().
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Me.AxWebBrowser 1.Navigate2(Env ironment.Comman dLine)
End Sub
I would use Environment.Com mandLine if I wanted to parse the complete
command line myself, otherwise I would use Environment.Get CommandLineArgs () which seperates the command line into individual string tokens... However I mostly use the Sub Main(args() As String) method.

Hope this helps
Jay


"Robert" <ca*****@linuxm ail.org> wrote in message
news:eA******** ******@TK2MSFTN GP10.phx.gbl...
"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:ey******** ******@tk2msftn gp13.phx.gbl...
Hi Robert,

This seems to me a total different approach, you did something as this

Open a new windows application project

In the toolbox rightclick and select add/Remove items

In the customize toolbox select Com and in that Microsoft Webbrowser

When that is in the toolbox drag it to your form
Drag also a button to your form.

Then this code and you have a mini Webbrowser.

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Me.AxWebBrowser 1.Navigate2("ww w.google.com")
End Sub

While that www.google.com can be a textbox of course or your html file.
A very complete sample is here.

webbrowser
http://support.microsoft.com/?kbid=311303

And what more documentation.
mshtml

http://msdn.microsoft.com/library/de...ng/hosting.asp

Right. Like I said I have it almost completed. It does not (and the

examples
above do not) allow me to pass an HTML file from the command line. I can
drop an HTML file on the running app and that works. I would also not like to have to hard code a path. I am new to VB.NET so maybe I am not focusing my thoughts correctly. : )


Thanks!!!
Nov 20 '05 #9

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

Similar topics

5
5935
by: Paul | last post by:
I want to use sessions to cover myself in case the user switches off cookies so I am passing the session ID manually through a hidden input field. This is what I have so far. index.php page contains: <?php $_SESSION = ""; $_SESSION = "";
1
7775
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains: ---------------------------------------------------------------------------- <?php ini_set("session.use_cookies", "off"); ini_set("session.use_trans_sid", "on"); session_start(); $_SESSION = ""; $_SESSION = ""; echo "<form method='POST' action='login.php'>
14
3137
by: Antoni | last post by:
Hello, I wondered if anyone could offer some guidance over my php script. I was hoping the example would allow the user to click the submit buttons and the item number increment. And when the user clicks, the my basket icon the items.php scripts starts and the variables from the current script are passed to this. I tried to display the variables as the items are incremented, though
4
8522
by: Jason Us | last post by:
Does anyone have experience with passing variables from an ASP page to a JSP page. The way it currently works in passing the SSN in the URL. This cannot be good. I thought that storing a unique session ID in a cookie and referencing the SSN from the Session ID would be the correct way to do this. But since we have two separate servers, IIS and Websphere, how do we coordinate the session ID?
12
6528
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the courses to pass the correct option value and then be displayed at the following URL: http://www.dslextreme.com/users/kevinlyons/selectResults.html I am passing countries, products, and courses. The first two display
7
2632
by: Ramesh | last post by:
Hai all, I am interested to know how the following can be done. I don't deal with HTML much and therefore would like to get help. The user should be able to see a link. Upon clicking the link an application (e.g. Calculator) is launched. The launched application should be able to request the Web Browser environment to pass any and all parameter values.
1
2406
by: cirillo_curiosone | last post by:
Hi, i'm new to javascript. I started studing it on the web few weeks ago, but still haven't been able to solve one big problem: HOT TO PASS VALUES FROM A SCRIPT VARIABLE TO A CHILD HTML GENERATED BY FUNCTION. Here'e the point: I'm writing a simple website for showing my photographs. It has a central page with many links (as many as galleries are).
29
4989
by: wayne | last post by:
Hey there... I'm having some problems passing url parameters with an open.window command. I'm not terribly familiar with java script but here is the code below. When executed it opens the window properly but does not pass the parameter. (this is part of a coldfusion template) <a href="##"
2
1503
by: Chris Dunaway | last post by:
I'm working on a Windows Forms app that communicates with a server through web services. One requirement that I have is that I need to be able to send a .wav file as well as a number of records to the server. What is the recommended method for doing this? I can package the data records into a dataset and send that, but how would I send the .wav file? I want to create a web method that will take both in one call but I'm not sure how...
0
7899
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
8392
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
8397
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
8050
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
5850
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
3897
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
3939
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2412
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
1
1504
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.