【发布时间】:2010-09-29 06:12:00
【问题描述】:
例如:http://stackoverflow.com/questions/396164/exposing-database-ids-security-risk 和 http://stackoverflow.com/questions/396164/blah-blah 加载相同的问题。
(我猜这是 Questions 表的 DB id?这是 ASP.NET 中的标准吗?)
在您的网络应用中使用这种类型的方案有什么优缺点?
【问题讨论】:
-
如何有效地从数据库中获取该问题?
-
easy - 正则表达式 URL(.NET MVC 为您执行此操作),将字符串“396164”转换为 int,然后进行查找。 :)
标签: url web-applications url-routing slug