Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VBVB.NET
Hiya,
 
I am currently working on an implementation of a local help system with links which are in the following format:
 
System.Diagnostics.Process.Start("file:///D:/Folder/Default.htm#Product.htm")
 
However when the user clicks the button which loads this, it only loads up to the # symbol and doesn't show the rest. The path shown in the browser is file:///D:/Folder/Default.htm. I've tried internet links with the # symbol in and they're fine, it's just links to local files which don't work. Can anyone offer an alternative library to use so I can use it in this way?
Posted 25-Sep-12 3:32am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I can confirm it. At least this is how it works with start issued from the Shell with Mozilla SeaMonkey browser of the most recent version, with Windows 7. It looks like the anchor is ignored.
 
Interestingly, if I use the Web browser application file directly, it works correctly. For example, this should work:
string browser = //...; path name of the browser application
string commandLine = "file:///D:/Folder/Default.htm#Product.htm";
System.Diagnostics.Process.Start(browser, commandLine);
 
I do understand that this solution is not very good, because it is not universal, but what you can do if we have such a defect in the Shell (because this example shows that the browser works correctly, so this a kind of defect in the Shell API, not the browser)?
 
You can improve it using the same code, only you would need to calculate the browser full path name out of the data retrieved from system Registry.
 
[EDIT]
 
Use the Registry key:
HKEY_CLASSES_ROOT\http\shell\open\command
 
Please see:
http://msdn.microsoft.com/en-us/library/microsoft.win32.registry.aspx[^].
 
See also this CodeProject article:
Read, write and delete from registry with C#[^].
 
—SA
  Permalink  
v7

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 756
1 OriginalGriff 452
2 Tadit Dash 350
3 sanket saxena 329
4 Peter Leow 228
0 Sergey Alexandrovich Kryukov 11,890
1 OriginalGriff 7,335
2 Peter Leow 5,003
3 Abhinav S 3,943
4 Maciej Los 3,575


Advertise | Privacy | Mobile
Web01 | 2.8.140421.2 | Last Updated 25 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid