如何使用C#在asp.net中编码整个URL路径. [英] How to encode whole url path in asp.net with C#.

查看:73
本文介绍了如何使用C#在asp.net中编码整个URL路径.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想在asp.net 4.0,C#中编​​码整个URL路径.它不应显示人类可读的格式. http://www.codeproject.com/Questions/ask.aspx.我想为当前运行项目的所有页面都加密整个URL路径.
请帮我.我将等你的答复.

在此先谢谢您.

Hi All,

I want encode whole URL path in asp.net 4.0, C#. It should not show human readable format.E.g. http://www.codeproject.com/Questions/ask.aspx. I want encryp whole url path for all pages present the current running project.
Please help me. I will be waiting for your reply.

Thanks in advance.

推荐答案

域部分无法加密".如果您确实想这样做,请购买一个奇怪的(如您所说的已加密)域名.但这对每个请求都是一样的. URL的其余部分由您控制.使用URL重写模块按需处理它们.

但正如SA所问-您为什么要这么做?如果您以大众为目标,那么出于明显的原因,您永远都不会这样做.而且该网站将在有限的人群中使用,这样做也是没有意义的.

从我的角度来看,您可能需要考虑设计并考虑将登录添加到您的网站.也不要传递您不想在URL中看到的数据.
The domain part cannot be "encrypted". If you really want to do so, buy a weird (encrypted as you say) domain name. But that will be same with every request. The rest part of the URL is under your control. Use URL Rewrite module to handle them as you want.

But as SA asked - why do you want to do so? If you are targeting mass, you would never do that for obvious reasons. And it the website will be used within limited group of people, doing this doesn''t make sense as well.

From where I see, you may need to consider your design and consider adding login to your website. Also do not pass data that you don''t want to be seen in the URL.


这篇关于如何使用C#在asp.net中编码整个URL路径.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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