在 C# 中更改 Web 浏览器的 URL
我正在使用 C# 设计一个简单的应用程序,其中有一个 Web 浏览器。我需要(最好)刷新浏览器中当前的页面,或者导航到“新”网址。我尝试了 Browser.Url = new Uri("http://www.pandora.com/");
但当我尝试编译它时出现错误。
错误 1 无法隐式转换类型 ‘字符串’到 'System.Uri' c:\users\sean\documents\visual 工作室 2010\Projects\Pandora\Pandora\Form1.cs 51 27 潘多拉
我做错了什么?
I am designing a simple application using c# and it has a web browser in it. I need to either (preferably) refresh the page that is currently inside the broswer, or navigate to a "new" url. I tried Browser.Url = new Uri("http://www.pandora.com/");
but I get an error when I try to compile it.
Error 1 Cannot implicitly convert type
'string' to
'System.Uri' c:\users\sean\documents\visual
studio
2010\Projects\Pandora\Pandora\Form1.cs 51 27 Pandora
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
出于某种原因,它希望我这样写:
这有效,所以很好。
For some reason, it wanted me to write it like this:
This works so thats good.