URL编码和解码 [英] URL Encoding and Decoding
本文介绍了URL编码和解码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想通过URL和我的code是:
I want to pass URL and my code is:
MyUrl = "http://www.abc.co.in/Download.aspx?period=" + Server.UrlEncode
(DateTime.Now.ToString("dd-MMM-yyyy")) + "&ProductName="
+ Server.UrlEncode(productName) + "";
mail.Body += "<a href=" + MyUrl + ">Demo Download</a>";
但就像我依然获得输出:
But still I'm getting output like:
http://www.abc。 co.in/Download.aspx?period=12-Apr-2013&ProductName=Otja
那么,什么是错的我的code和如何去code它 download.aspx
?
So what is wrong with my code and how to decode it on download.aspx
?
推荐答案
使用 HttpUtility.UrlEn code
从的System.Web
命名空间。
HttpUtility.UrlEn code方法:MSDN链接
这篇关于URL编码和解码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文