Open a html file using default web browser

前端 未结 4 875
执笔经年
执笔经年 2021-01-04 00:57

I\'m using this to get the path and executable of default web browser:

public static string DefaultWebBrowser
        {
            get
            {

               


        
4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-04 01:02

    Im using a code, where i look up for exe files first. For example, if exsists chrome.exe (in its default path) else if exists firefox.exe or launcher.exe (for opera) etc... if doesnt any exists, try to run iexplore.exe with pathToHtmlFile parameter. This is my solution, where i use external config, where a set my browser, doesnt matter what is set default in OS.

提交回复
热议问题