简体   繁体   中英

Cannot parse a correct URI

I have this link: www.axams-freizeitzentrum.com/ruifach-stadion.htm

when I try to create an Uri using this code:

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.

what is wrong?

Check possible reasons here: http://msdn.microsoft.com/en-us/library/z6c2z492(v=VS.100).aspx

You need to put the protocol prefix in front the address, ie in your case "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");

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