0

I can't get my C# program to open the html page at the desired location.

E.g.

System.Diagnostics.Process.Start(@"C:\file.htm");

works fine. It opens the page at the top.

But if I type

System.Diagnostics.Process.Start(@"C:\file.htm#bookmark");

it still just opens at the top of the page (instead of at the bookmark where I want it to open.

Any ideas?

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by thines01
0

I've noticed that even if you save a shortcut to an HTML FILE to your desktop, it strips off the bookmark before it saves. The bookmark code interferes with the filename.
So, something like:
file:///C:/Documents%20and%20Settings/mememe/Desktop/fred.htm#bookmark2
becomes:
file:///C:/Documents%20and%20Settings/mememe/Desktop/fred.htm
when saved.

You *can* however, create a second page (let's say Joe.htm) that has some relocation javascript in it that sends you to fred WITH THE BOOKMARK!

Contents of Joe.htm

<script language="javascript">
 window.location.href="file:///C:/Documents%20and%20Settings/mememe/Desktop/fred.htm#bookmark2";
</script>

When it opens, it will load Fred.htm and navigate to the bookmark.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.