简体   繁体   中英

C# WebBrowser.Navigate Issue

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

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

WebBrowser1.Navigate(Path.Combine(Application.StartupPath, "File.xml"));
webBrowser1.Navigate(Environment.CurrentDirectory + @"\File.xml");

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

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