简体   繁体   中英

Open url in Webbrowser without www. in C#

I have a program where you can enter a word and it opens the wikipedia article.

This is my code( input is my word):

string url = "http://de.wikipedia.org/wiki/" + input.Replace(" ", "_");
Process.Start(url);

But when I start the website with Process.Start(url) it starts " http://www.de.wikipedia.org/wiki/XYZ " instead of " http://de.wikipedia.org/wiki/XYZ "

How can I open a website without the www.

Kind regards

您应该尝试启动chrome并将URL作为参数传递:

            Process.Start(@"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", "--app=http://de.wikipedia.org/wiki/");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM