C# WebBrowser.Navigate 问题

发布于 2024-07-18 06:15:46 字数 205 浏览 4 评论 0原文

我有一个 XML 文件存储在我的应用程序的 BIN 文件夹内的 DEBUG 文件夹中 (BIN\DEBUG\File.xml)

当我调用 WebBrowser1.Navigate("File.xml"); 时

它不会根据文件的显示来更新视图。 我知道这与由于文件夹位置不正确而找不到文件有关。 必须从此文件夹位置访问该文件。

感谢帮助

I have an XML file stored in the DEBUG folder inside the BIN Folder of my Application (BIN\DEBUG\File.xml)

When i call WebBrowser1.Navigate("File.xml");

It doesn't update the view with the display of the file. I know it's something to do with it not locating the file due to the folder location being incorrect. The file has to be accessed from this folder location.

Help appreciated

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

默嘫て 2024-07-25 06:15:46

您是否将 WebBrowser1.AllowNavigation 设置为 true? 你有没有尝试过:

WebBrowser1.Navigate(Path.Combine(Application.StartupPath, "File.xml"));

Do you have WebBrowser1.AllowNavigation set to true? Have you tried:

WebBrowser1.Navigate(Path.Combine(Application.StartupPath, "File.xml"));
枫林﹌晚霞¤ 2024-07-25 06:15:46
webBrowser1.Navigate(Environment.CurrentDirectory + @"\File.xml");

当然,如果目录没有更改,这就是我使用的。 :)

webBrowser1.Navigate(Environment.CurrentDirectory + @"\File.xml");

This is what I use, if the directory hasn't been changed, ofcourse. :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文