一个比较实用的asp函数集合类

2016-01-29 18:54 2 1 收藏

一个比较实用的asp函数集合类,一个比较实用的asp函数集合类

【 tulaoshi.com - ASP 】

 

最近迷恋上作网站了,使用asp开发,发现asp有好多的漏洞,而且在一个网站中有好多的代码是重复使用的,所以就查询了一些资料发现在asp中可以使用类的思想,所以就写了这个类,写的不好,但是比较实用。

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/asp/)

<meta http-equiv="Content-Type" content="text/html; charset=gb2312"
<%
Const Btn_First="<font face='webdings'9</font"  '定义第一页按钮显示样式
Const Btn_Prev="<font face='webdings'3</font"  '定义前一页按钮显示样式
Const Btn_Next="<font face='webdings'4</font"  '定义按钮显示样式
Const Btn_Last="<font face='webdings':</font"  '定义最后一页按钮显示样式

Class clsDSJ
 Private p_Error,p_IpAdd,p_Debug,Errs
 Private p_InvaildWords
 Private tmpStr
 Private objConnDivPage,rsDivPage,p_GetSQL,p_nPage
 Private p_rsPageSize,p_intCurPage,p_strURL,p_intTotalPage,p_intTotalRecords
 Private p_dbType,p_dbFolder,p_DataBase,dbPath,p_dbUserID,p_dbPassword,p_sqlDataSource
 Private param_DataBase,param_dbUserID,param_dbPassword,param_dbType
 'Property
 Public objConn,ConnStr,SQLQueryNum
 Public logDB,WebURL
 Public SaveLog
 Public ErrCodes,ErrCode,ErrMsg
 Public ScriptFolder,ScriptName
 
 Private Sub Class_Initialize
  p_Debug=True
  ClientConnected
  SaveLog=True
  ErrMsg=""
  p_Error=0
  SQLQueryNum=0
  Rem  数据库连接初始化
  dbType=12  '取1x——Access,2x——SQL;x1——OLEDB,x2——ODBC
  dbFolder="Data"
  DataBase="zhubizidatabase.MDB"
  dbUserID=""
  dbPassword=""
  sqlDataSource=""
  p_rsPageSize=10
  'p_nPage=2
  If request("page")="" Then
   p_intCurPage=1
  ElseIf NOT IsNumeric(request("page")) Then
   p_intCurPage=1
  ElseIf CInt(Trim(request("page")))<1 Then
   p_intCurPage=1
  Else
   p_intCurPage=CInt(Trim(request("page")))
  End If
  WebURL="http://blog.csdn.net/alonesword/"
  tmpStr=Request.ServerVariables("PATH_INFO")
  tmpStr=Split(tmpStr,"/",-1)
  ScriptName=Lcase(tmpStr(UBound(tmpStr)))
  ScriptFolder=LCase(tmpStr(UBound(tmpStr)-1)) & "/"
  p_InvaildWords="select|update|delete|insert|@|--|;|'|#|%|xp|cmd|shell"
 End Sub
 
 Private Sub Class_terminate()
  If IsObject(rsDivPage) Then rsDivPage.Close:Set rsDivPage=Nothing
  If IsObject(objConn) Then objConn.Close:Set objConn=Nothing
 End Sub

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/asp/)

 Public Property Get Version
  Version="DSJ 1.1.0 Beta"
 End Property
 
 Public Property Get Error
  Error=p_Error
 End Property
 
 Public Property Get Debug
  Debug=p_Debug
 End Property
 Public Property Let Debug(BoolDebug)
  If BoolDebug Then
   p_Debug=True
  Else
   p_Debug=False
  End If
 End Property
 
 Public Property Get dbType
  dbType=p_dbType
 End Property
 Public Property Let dbType(lngdbType)
  If IsNumeric(lngdbType) Then
   p_dbType=lngdbType
  Else
   p_dbType=12
  End If
 End Property
 
 Public Property Get dbFolder
  dbFolder=p_dbFolder
 End Property
 Public Property Let dbFolder(strFolder)
  If Right(strFolder,1)="" OR Right(strFolder,1)="/" Then
   p_dbFolder=strFolder
  Else
   If (NOT IsNull(strFolder)) OR (strFolder<"") Then
    p_dbFolder=strFolder & ""
   Else
    p_dbFoler=""
   End If
  End If
 End Property
 
 Public Property Get Database
  Database=p_dataBase
 End Property
 Public Property Let Databas

来源:https://www.tulaoshi.com/n/20160129/1507752.html

延伸阅读
一个实用的 CToolBar 扩展类 CToolBarEx 作者:xiaojin 下载源代码 我们知道,程序中的工具条是在CMainFrame中生成的,采用的类是CToolBar,使用起来很复杂。为此,对CToolBar的常用功能进行封装,生成了它的一个继承类CToolBarEx,大大简化了操作。本文参考了 VCKBASE 以前发表的关于工具条的文章,在此先表...
标签: Web开发
一个Javascript 的类库,用于table内容排序。使用很方便,不用每次都去调用数据库了。 特别适合多表查询的排序。加上的style.display 切换,也可以实现分页。 效果演示 用法: 1.添加JS QUOTE: 以下是引用片段: 2.添加TABLE,注意的是:一定要有ID,class为"sortable" QUOTE: OK,可以了,简...
标签: ASP
我们继续接上期 在页面里通过调用ShowPage()的方法显示出来,ShowPage可以在GetRS以后的任意位置调用,也可以调用多次 Public Sub ShowPage() Dim str_tmp int_totalRecord=XD_RS.RecordCount If int_totalRecord<=0 Then   str_error=str_error & "总记录数为零,请输入数据"   Call ShowError() End If If int_totalRec...
  Ehlib3.0版本以上虽然支持排序功能,但不支持带有Order By的SQL语句,而且排序很慢;我写的这个排序函数,利用ADO的sort方法,排序很快,几万条数据也是很快。该函数支持Lookup字段排序,不支持计算字段排序,因为计算字段值在内存里高速运算。排序分为:升序、降序和默认三种,支持排序图标。 procedure   SortDBG...
标签: Web开发
% '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% '快速字符串连接类 '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% '名称:Class_FastString '

经验教程

973

收藏

22
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部