473,320 Members | 1,862 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.

How to open a browser c# (htm file in a remote location with a url having parameters)

Hi,

I want to Open a browser with a url like following
file://remotecomp1/Doc/en/Models/default2.htm?openpage=file://remotecomp1/Doc/en/DocYY/file.htm

But when I tried it using the following code.

System.Diagnostics.Process.Start("file://remotecomp1/Doc/en/Models/default2.htm?openpage=file://remotecomp1/Doc/en/DocYY/file.htm");

The browser opens a browser with the following URL.

\\remotecomp1\Doc\en\Models\default2.htm

Can anyone help me with this?
Sep 9 '08 #1
3 8706
JamieHowarth0
533 Expert 512MB
Hi there,

The file "protocol" is a Windows instruction to open the specified location, parse the file URI, and open the necessary document in Explorer. If you want the browser to open the remote URI then use http: instead of file:.

Hope this helps.

medicineworker
Sep 9 '08 #2
Curtis Rutland
3,256 Expert 2GB
Or you could use a ProcessStartInfo object to specify the file you want to start and then the arguments you want to pass.

For example (this assumes you have IE7):
Expand|Select|Wrap|Line Numbers
  1. System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(@"c:\windows\ie7\iexplore.exe", @"c:\dev\template.xml");
  2. //This opens internet explorer 7 and loads the path I specified as the second parameter.
  3. System.Diagnostics.Process.Start(psi);
  4.  
However, it is better to pass the single argument in as http:// instead of file:/// so that the OS can decide which program to open it with.
Sep 9 '08 #3
Hi everybody,

Thank you for your replies.

It is possible to use the following code, for fullfilling my requirement. Is there a generic Browser class instead of InternetExplorerClass.

Expand|Select|Wrap|Line Numbers
  1. SHDocVw.InternetExplorerClass ie = new SHDocVw.InternetExplorerClass();
  2. Object vHeaders = null;
  3. Object vPost = null;
  4. Object vTarget = null;
  5. Object vFlags = null;
  6. ie.Navigate("file://remotecomp1/Doc/en/Models/default2.htm?openpage=file://remotecomp1/Doc/en/DocYY/file.htm", ref vFlags, ref vTarget, ref vPost, ref vHeaders);
  7. ie.Visible = true;
  8.  
Sep 10 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: lukeo | last post by:
I'm shelling out to an .asp (or htm) page from an application. I want to show this in a window without the address bar, etc... Is there a way I can redirect this page using javascript to a page...
1
by: William Starr Moake | last post by:
Another problem with the browser-based WYSIWYG editor I'm trying to assemble using IE's design mode. This opens the selected page in the editor iframe named iView: <select name="template"...
5
by: Sean Berry | last post by:
I have a news video that I am sending out for a client. There are embedded links to flash movies in the email. I want the popup to be a set size (400 x 400). I am currently using the...
4
by: Ian Sedwell | last post by:
Hi guys The following code works just fine in Netscape on MacOS and Windows. But in Explorer on MacOS and Windows it throws a type mismatch error at the point marked with the comment ³// bug out...
10
by: Ian Rastall | last post by:
I've got a small search page at http://www.sundry.ws/search.html and I would like to add a section that allows me to open files on my computer, instead of having to go to File > Open. It's just...
29
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...
6
by: Tim Cowan | last post by:
Hi I have the following code to write an error file and it is supposed to open the HTML file in a browser when an error occurs. It creates the file Ok but doesn't open the new browser and doesn't...
3
by: Stuart Read | last post by:
Hi, - I'm running .NET framework 1.1 on win2k server I'm investigating error pages at the moment. I have found how to: a) display friendly or real .NET errors in the remote browser, by...
18
by: len.hartley | last post by:
Hi, I am trying to pop-up a window when the user clicks on an image. The problem is that when the user clicks on the image and the window pops up OK, but the window underneath also proceeds 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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.