Var hi =“ https://stackoverflow.com/questions/ask”; URI hello =新的Uri(hi); 输出: 当我单击“ hi”时,它应该指示我堆栈溢出 “ https://stackoverflow.com/questions/ask”;
结果: 我希望“ hi”变量保存值https://stackoverflow.com/questions/ask.but,当它运行时应显示“ hi”变量而不是Url路径,我正在c#的“ URI”中尝试执行这些操作,有人可以帮助我吗?预先感谢
注意:https://stackoverflow.com/questions/ask“>嗨 就像超链接一样,但希望仅在c#中使用URI才能实现
答案 0 :(得分:0)
尝试
string hi =@"https://stackoverflow.com/questions/ask";
Uri hello = new Uri(hi);