我正在使用c#设计一个简单的应用程序,它里面有一个Web浏览器。我需要(最好)刷新当前在broswer中的页面,或者导航到“新”URL。我试过Browser.Url = new Uri("http://www.pandora.com/");
但是当我尝试编译时出错了。
错误1无法隐式转换类型 '字符串'到 'System.Uri'c:\ users \ sean \ documents \ visual 工作室 2010 \ Projects \ Pandora \ Pandora \ Form1.cs 51 27 Pandora
我做错了什么?
答案 0 :(得分:6)
出于某种原因,它希望我这样写:
Browser.Url = new System.Uri("https://www.pandora.com/", System.UriKind.Absolute);
这样做很好。