我有一个编码的网址如下;
dim inStr As String ="https%3A%2F%2Fmyweb%2page1%2Egov%2Emy%3A448%2Fserver%2FForm%3Fuserid%3Dtrouble"
我想解码网址并将此网址分配给我的webBrowser
控件。
从此thread:
Dim decodedUrl As String = HttpUtility.UrlDecode(encodedUrl)
我有一个解码片段,但我没有使用网络应用程序,正在使用windows application
;任何人都可以建议我这样做的最好方法吗?
答案 0 :(得分:0)
您可以使用Uri.UnescapeDataString()
方法,如下所示:
Dim inputURL As String = "https%3A%2F%2Fmypage%2Eme%2Epage%2Esample%3A448%2Flfserver%2FForm%3Fuserid%3DTrouble"
Dim outputURL As String = Uri.UnescapeDataString(inputURL)
输出将为 https://mypage.me.page.sample:448/lfserver/Form?userid=Trouble