如何实现网站安全 [英] how to implement website security

查看:75
本文介绍了如何实现网站安全的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨......大家。

你可以帮助我,如何为我们的网站提供安全保障。你可以为此提供任何示例代码。

谢谢你。

Hi...everyone.
can u help me,how to provide security to our website. Can u provide any sample code for this.
thank u.

推荐答案

你可以通过检查<中的URL来增加global.asax的安全性。 b>Application_BeginRequest。



You can add security in global.asax by checking URL in "Application_BeginRequest".

string[] blacklist = new string{/*list of kewords like execute,.php,.html,<scripts>,</scripts>,alert*/};
            foreach (var item in blacklist)
	{
            if(Request.Url.AbsoluteUri.Contains(item))
                //redirect to login page
		 
	}





此代码检查网址包含一些不需要的和有害的关键字到网站,如SQLInjection等。



然后你可以创建自己的角色和用户管理或用户ASP.Net会员资格,用于每页上的身份验证。



this code check url contains some unwanted and harmfull keywords to website like SQLInjection etc.

then you can create your own Role and User Management or user ASP.Net Membership for authentication on each page.


在询问示例代码之前,您需要了解它。如果您不清楚它意味着什么,那么示例代码将毫无用处。阅读 [ LINK ]了解安全基础和ASP.NEt支持。
You need to learn about it before asking for sample code. If you are not clear what it means then sample code will be useless. Read this [LINK] to understand Security Basics and ASP.NEt support.


这篇关于如何实现网站安全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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