asp文件搜索
asp文件搜索
<%
'*************Set newsearch=new SearchFile '声明 *************
'*************newsearch.Folder="F:+E:"'传入搜索源*************
'*************newsearch.keyword="汇编" '关键词*************
'*************newsearch.Search '开始搜索*************
'*************Set newsearch=Nothing '结束*************
'*************************************************************
Server.ScriptTimeOut =99999 '程序加载的超时设置
Class SearchFile
dim Folders '传入绝对路径,多路径使用+号连接,不能有空格
dim keyword '传入关键词
dim objFso '定义全局变量
dim Counter '定义全局变量,搜索结果的数目
'*****************初始化**************************************
Private Sub Class_Initialize
Set objFso=Server.CreateObject("Scripting.FileSystemObject")
Counter=0 '初始化计数器
End Sub
'************************************************************
Private Sub Class_Terminate
Set objFso=Nothing
End Sub
'**************公有成员,调用的方法***************************
Function Search
Folders=split(Folders,"+") '转化为数组
keyword=trim(keyword) '去掉前后空格
if keyword="" then
Response.Write("<font color='red'>关键字不能为空</font><br/>")
exit Function
end if
'判断是否包含非法字符
flag=instr(keyword,"\") or instr(keyword,"/")
flag=flag or instr(keyword,":")
flag=flag or instr(keyword,"|")
flag=flag or instr(keyword,"&")
if flag then '关键字中不能包含\/:|&
Response.Wr
相关文档:
服务器端组件
首先,服务器端的组件要有别于客户端的组件.客户端的组件是通过网络传输,依*HTML来起作用.而且只能在IE上有用.但是服 务器端的组件是运行在服务器端,它在服务器上执行各种操作.因此,所有的浏览器都能享用,它依*的是服务器而不是浏览器.
当IIS被请求执行一个ASP程序,它首先会在ASP文件中找到〈%%>标签之间 ......
以下为引用的内容:
<!--这是一个主页文件-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>幻灯片新闻</title>
</head>
<body>
<!--#Include file="diaoyong.asp"-->
</body>
</html>
& ......
ASP+Access数据库的18条安全法则:
1.首先,我们需要过滤所有客户端提交的内容,其中包括?id=N一类,另外还有提交的html代码中的操作数据库的select及asp文件操作语法,大家可以把提交的字符转义,然后再存入数据库。
2.然后需要对访问Access数据库的页面进行授权,针对显示数据页面只能使用select语句,过滤其他的update,asp ......
<%
Dim Conn, Connstr
Dim strServer, strUid, strPwd, strDB
strServer = "HUA-5780C2D1CCF" 'SQL数据库服务器地址
strUid = "sa" '数据库用户名
strPwd = "123456" ......