WebBrowser网址问题
-
08-07-2019 - |
题
我的Windows应用程序文件夹中有一个html页面index.html。现在我想将它设置为form1中的webbrowser的url。我该怎么做?在Windows中的Web应用程序中是否有像 server.mappath()
这样的语法?
示例:
Uri repuri = new Uri("index.html");
webBrowser1.Url = repuri;
我该如何映射?
解决方案
Application.ExecutablePath
返回exe文件的完整路径,包括文件名本身。您可以使用它来构建HMTL文件的路径。
不隶属于 StackOverflow