简体   繁体   English

无法解析正确的URI

[英]Cannot parse a correct URI

I have this link: www.axams-freizeitzentrum.com/ruifach-stadion.htm 我有此链接: www.axams-freizeitzentrum.com/ruifach-stadion.htm

when I try to create an Uri using this code: 当我尝试使用以下代码创建Uri

var link = new Uri("www.axams-freizeitzentrum.com/ruifach-stadion.htm");

this will return 这将返回

Invalid URI: The format of the URI could not be determined. 无效的URI:无法确定URI的格式。

what is wrong? 怎么了?

Check possible reasons here: http://msdn.microsoft.com/en-us/library/z6c2z492(v=VS.100).aspx 在此处检查可能的原因: http : //msdn.microsoft.com/zh-cn/library/z6c2z492(v=VS.100).aspx

You need to put the protocol prefix in front the address, ie in your case "http://" 您需要将协议前缀放在地址前面,即您的情况下为“ http://”

var link = new Uri("http://www.axams-freizeitzentrum.com/ruifach-stadion.htm");

Uri需要一个方案名称。

var link = new Uri("http://www.axams-freizeitzentrum.com/ruifach-stadion.htm");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM