<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Kommentare zu: C#: Webseite im Standardbrowser öffnen (CSharp)</title>
	<atom:link href="http://www.yourhelpcenter.de/2008/12/c-webseite-im-standardbrowser-offnen-csharp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yourhelpcenter.de/2008/12/c-webseite-im-standardbrowser-offnen-csharp/</link>
	<description>Hilfe &#38; Support für IT Probleme</description>
	<lastBuildDate>Wed, 08 Sep 2010 06:46:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>Von: Robert</title>
		<link>http://www.yourhelpcenter.de/2008/12/c-webseite-im-standardbrowser-offnen-csharp/comment-page-1/#comment-1158</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Sun, 21 Feb 2010 10:20:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.yourhelpcenter.de/?p=184#comment-1158</guid>
		<description>Danke. funktioniert sehr gut und hikft mir bei meinen Porjekt.</description>
		<content:encoded><![CDATA[<p>Danke. funktioniert sehr gut und hikft mir bei meinen Porjekt.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: admin</title>
		<link>http://www.yourhelpcenter.de/2008/12/c-webseite-im-standardbrowser-offnen-csharp/comment-page-1/#comment-453</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Wed, 26 Aug 2009 09:04:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.yourhelpcenter.de/?p=184#comment-453</guid>
		<description>Danke für die Mühe und Antwort. Wir möchten die lange Suche und Durchklickerei durch Webseite kürzen. Daher haben wir den Vorschlag hier ebenfalls (mit Quellenverweis) eingefügt.

Quelle: www.dstruebig.de (hier finden Sie das komplette Beispiel mit mehr Infos)

&lt;pre lang=&quot;csharp&quot; line=&quot;1&quot;&gt;private string GetDefaultBrowser() {
  string browser = string.Empty;
  RegistryKey key = null;
  try {
    key = Registry.ClassesRoot.OpenSubKey(@&quot;HTTP\shell\open\command&quot;);
    // trim off quotes
    if (key != null)
      browser = key.GetValue(null).ToString().ToLower();
    // get rid of everything after the &quot;.exe&quot;
    if (!browser.EndsWith(&quot;exe&quot;)) {
                browser = browser.Substring(0, browser.LastIndexOf(&quot;.exe&quot;)+4);
                browser = browser.Substring(1);
    }
  }
  finally {
    if (key != null) 
      key.Close();
  }
  return browser;
}&lt;/pre&gt;

Aufruf dann im Beispiel:

&lt;pre lang=&quot;csharp&quot; line=&quot;1&quot;&gt;private void OpenFileInBrowser(string filenameToOpen) {
  string browser = GetDefaultBrowser();
  Process.Start(browser, filenameToOpen);
}&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Danke für die Mühe und Antwort. Wir möchten die lange Suche und Durchklickerei durch Webseite kürzen. Daher haben wir den Vorschlag hier ebenfalls (mit Quellenverweis) eingefügt.</p>
<p>Quelle: <a href="http://www.dstruebig.de" rel="nofollow">http://www.dstruebig.de</a> (hier finden Sie das komplette Beispiel mit mehr Infos)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">private</span> <span style="color: #FF0000;">string</span> GetDefaultBrowser<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
  <span style="color: #FF0000;">string</span> browser <span style="color: #008000;">=</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Empty</span><span style="color: #008000;">;</span>
  RegistryKey key <span style="color: #008000;">=</span> null<span style="color: #008000;">;</span>
  <span style="color: #0600FF;">try</span> <span style="color: #000000;">&#123;</span>
    key <span style="color: #008000;">=</span> Registry.<span style="color: #0000FF;">ClassesRoot</span>.<span style="color: #0000FF;">OpenSubKey</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">@&quot;HTTP\shell\open\command&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008080; font-style: italic;">// trim off quotes</span>
    <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>key <span style="color: #008000;">!=</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
      browser <span style="color: #008000;">=</span> key.<span style="color: #0000FF;">GetValue</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToLower</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008080; font-style: italic;">// get rid of everything after the &quot;.exe&quot;</span>
    <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #008000;">!</span>browser.<span style="color: #0000FF;">EndsWith</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;exe&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
                browser <span style="color: #008000;">=</span> browser.<span style="color: #0000FF;">Substring</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">0</span>, browser.<span style="color: #0000FF;">LastIndexOf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;.exe&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">+</span><span style="color: #FF0000;">4</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                browser <span style="color: #008000;">=</span> browser.<span style="color: #0000FF;">Substring</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
  <span style="color: #000000;">&#125;</span>
  <span style="color: #0600FF;">finally</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>key <span style="color: #008000;">!=</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span> 
      key.<span style="color: #0000FF;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
  <span style="color: #000000;">&#125;</span>
  <span style="color: #0600FF;">return</span> browser<span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Aufruf dann im Beispiel:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">private</span> <span style="color: #0600FF;">void</span> OpenFileInBrowser<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> filenameToOpen<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
  <span style="color: #FF0000;">string</span> browser <span style="color: #008000;">=</span> GetDefaultBrowser<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
  Process.<span style="color: #0000FF;">Start</span><span style="color: #000000;">&#40;</span>browser, filenameToOpen<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
	</item>
	<item>
		<title>Von: Hain</title>
		<link>http://www.yourhelpcenter.de/2008/12/c-webseite-im-standardbrowser-offnen-csharp/comment-page-1/#comment-452</link>
		<dc:creator>Hain</dc:creator>
		<pubDate>Wed, 26 Aug 2009 08:47:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.yourhelpcenter.de/?p=184#comment-452</guid>
		<description>Ahoi,

Ich habe mich noch etwas umgeschaut. Man findet es nicht auf anhieb.
Aber ich habe eine Lösung bei mir im Blog beschrieben.
http://www.dstruebig.de/?e=55

1) default Browser aus der Registry auslesen
2) via Process.start(BROWSER, ARGUMENT) den Browser starten.</description>
		<content:encoded><![CDATA[<p>Ahoi,</p>
<p>Ich habe mich noch etwas umgeschaut. Man findet es nicht auf anhieb.<br />
Aber ich habe eine Lösung bei mir im Blog beschrieben.<br />
<a href="http://www.dstruebig.de/?e=55" rel="nofollow">http://www.dstruebig.de/?e=55</a></p>
<p>1) default Browser aus der Registry auslesen<br />
2) via Process.start(BROWSER, ARGUMENT) den Browser starten.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: admin</title>
		<link>http://www.yourhelpcenter.de/2008/12/c-webseite-im-standardbrowser-offnen-csharp/comment-page-1/#comment-451</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Tue, 25 Aug 2009 17:03:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.yourhelpcenter.de/?p=184#comment-451</guid>
		<description>Man kann z.Bsp. eine HTML Datei per c# erstellen &amp; öffnen, die Ihre XML Datei dann sofort nachlädt.
Wäre das eine Lösung ?</description>
		<content:encoded><![CDATA[<p>Man kann z.Bsp. eine HTML Datei per c# erstellen &#038; öffnen, die Ihre XML Datei dann sofort nachlädt.<br />
Wäre das eine Lösung ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Hain</title>
		<link>http://www.yourhelpcenter.de/2008/12/c-webseite-im-standardbrowser-offnen-csharp/comment-page-1/#comment-450</link>
		<dc:creator>Hain</dc:creator>
		<pubDate>Tue, 25 Aug 2009 15:12:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.yourhelpcenter.de/?p=184#comment-450</guid>
		<description>Das geht, weil für URL und html Seiten ein Browser als Standard Anwenudng hinterlegt ist, oder ?

Wonach ich suche,
ich möchte sicher !! den Standard Browser öffnen und dort z.B. eine XML anzeigen.
Auch wenn XML standardmässig nicht im Browser angezeigt wird, sondern z.B. mit einem XML Viewer verknüpft ist.

Nun, ich suche weiter.

Gruss</description>
		<content:encoded><![CDATA[<p>Das geht, weil für URL und html Seiten ein Browser als Standard Anwenudng hinterlegt ist, oder ?</p>
<p>Wonach ich suche,<br />
ich möchte sicher !! den Standard Browser öffnen und dort z.B. eine XML anzeigen.<br />
Auch wenn XML standardmässig nicht im Browser angezeigt wird, sondern z.B. mit einem XML Viewer verknüpft ist.</p>
<p>Nun, ich suche weiter.</p>
<p>Gruss</p>
]]></content:encoded>
	</item>
</channel>
</rss>
