我们可以使用Asp.Net 2.0编写浏览器网址吗 [英] Can we encript the browser url using Asp.Net 2.0

查看:92
本文介绍了我们可以使用Asp.Net 2.0编写浏览器网址吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的先生/女士

我想对浏览器URL中的重定向路径进行加密,因此用户无法注意到文件的实际路径.

是否有可能在asp.net 2.0中使用c#?如果有可能,请帮助我.


关于问候

Ranjan Pati

Dear Sir/Mam

I want to encrypt my redirect path in browser URL, so user can not notice the actual path of files.

Is it possible in asp.net 2.0, using c# ? If it is possible please help me.


With regards

Ranjan Pati

推荐答案

您可以简单地创建一个包含诸如"www.mypage.com/download.aspx?file=somefile.zip"之类的参数的页面,页面处理请求.如果要确保人们不能直接与其他人共享此链接,则可以创建一个简单的数据库表,该表包含一个数字和一个时间(最大有效时间),并且当用户请求文件时,它将在其中添加一条记录.数据库,当实际到达"download.aspx"时,您只需删除记录并提供请求的文件即可.如果该号码不存在,则将其重定向到您喜欢的某个页面.确保定期清理表以清除从未使用过的添加的记录.

祝你好运!
You can simply make a page that takes an argument like "www.mypage.com/download.aspx?file=somefile.zip" and let this page handle the request. If you want to ensure that people can''t share this link directly to someone else you could create a simple database table that holds a number and a time (max time valid) and when the user requests a file it will add a record to the database and when actually reaching the "download.aspx" you simply delete the record and give the requested file. If the number doesn''t exists you redirect them to some page you like. Be sure to cleanup the table regularly to clear added records that where never used.

Good luck!


是的,有可能.您需要阅读有关URL重写的信息.

在此处阅读有关信息: MSDN:URL重写 [
Yes, it is possible. You need to read about URL Rewriting.

Read about it here: MSDN: URL Rewriting[^]


这篇关于我们可以使用Asp.Net 2.0编写浏览器网址吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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