整个URL必须在地址栏中加密 [英] Entire URL Has To Be Encrypted In The Address Bar

查看:188
本文介绍了整个URL必须在地址栏中加密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



Hi,

Can any one help me how to proceed to write the code for the URL encryption?

推荐答案

不知道为什么要这么做吗?通常,URL应该足够可读.
Not sure why do you want to do that? Usually, urls should be readable enough.


从这里开始-在asp.net中重写网址 [

[4:09:51 PM] GK:无效Application_BeginRequest(对象发送者,EventArgs e)
{
/*(字符串curruntpath = Request.Path.ToLower();

curruntpath = curruntpath.Trim();
bool被重定向= curruntpath.EndsWith(.aspx");
bool isredirected2 = curruntpath.EndsWith(.html");
bool isredirected3 = curruntpath.EndsWith(.jpg");
bool isredirected4 = curruntpath.EndsWith(.jpeg");
bool isredirected5 = curruntpath.EndsWith(.gif");
bool isredirected6 = curruntpath.EndsWith(.png");
//字符串atr = curruntpath.Substring(curruntpath.IndexOf("/"));
if(!redirected&&!isredirected2&&!isredirected3& amp;!isredirected4& amp; amp;!isredirected5& amp; amp; !! isredirected6)
{

HttpContext obj = HttpContext.Current;
字符串finalurl = curruntpath +".aspx";

如果(System.IO.File.Exists(Server.MapPath(finalurl)))
{
obj.RewritePath(finalurl);
}
其他
{
obj.RewritePath("Error.aspx");
}
}
如果(curruntpath.EndsWith(.aspx"))
{
HttpContext obj = HttpContext.Current;
//obj.RewritePath("Tohideextentions.aspx);
} */
}


任何人都可以帮助我解决上面提到的代码是否正确,以便对地址栏中的整个URL进行编码/加密.
[4:09:51 PM] GK: void Application_BeginRequest(object sender, EventArgs e)
{
/*( string curruntpath = Request.Path.ToLower();

curruntpath = curruntpath.Trim();
bool isredirected = curruntpath.EndsWith(".aspx");
bool isredirected2 = curruntpath.EndsWith(".html");
bool isredirected3 = curruntpath.EndsWith(".jpg");
bool isredirected4 = curruntpath.EndsWith(".jpeg");
bool isredirected5 = curruntpath.EndsWith(".gif");
bool isredirected6 = curruntpath.EndsWith(".png");
// string atr = curruntpath.Substring(curruntpath.IndexOf("/"));
if (!isredirected && !isredirected2 && !isredirected3 && !isredirected4 && !isredirected5 && !isredirected6)
{

HttpContext obj = HttpContext.Current;
string finalurl = curruntpath + ".aspx";

if (System.IO.File.Exists(Server.MapPath(finalurl)))
{
obj.RewritePath(finalurl);
}
else
{
obj.RewritePath("Error.aspx");
}
}
if (curruntpath.EndsWith(".aspx"))
{
HttpContext obj = HttpContext.Current;
//obj.RewritePath("Tohideextentions.aspx");
}*/
}


Can Any One Help Me Weather The Above Mentioned Code Is Right For The Entire URL In The Address Bar To Be Encoded/Encrypted.


这篇关于整个URL必须在地址栏中加密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆