linux社区爱心援助Linux认证系列教程业界动态站务新闻公司招聘网络学院网址大全LPI专题CISCO专题
设为首页
加入收藏
管理团队
JSP  
JAVA  
PERL  
 您的位置:首页 > 开发语言 > ASP >
栏目导栏
  php
  JSP
  ASP
  asp.net
  JAVA
  c/c++/c#
  perl
  JavaScript
  Basic
  Delphi
资料搜索
热门文章
·由HTTP 500 Internal server e
·会员系统“找回密码”的制作方
·ASP实现数字和字母组合并生成图
·简单的asp验证码程序示例
·用ASP制作强大的搜索引擎
·如何让图片自动缩放以适合界面
·如何用foreach遍历页面上所有的
·如何实现站点的RSS输出
·无组件实现文件上传/下载
·ASP如何获取真实IP地址
·asp中如何使用 HTML 表格
·采用XMLHTTP编写一个天气预报的
·80004005错误及其解决方法
·asp中如何调试 ASP 脚本
·asp+ajax打造无刷新新闻评论系
最新文章
·ASP教程:8、ASP内建对象Respo
·ASP教程:7、ASP内建对象Reque
·ASP教程:6、ASP脚本循环语句
·ASP教程:5、ASP脚本变量、函数
·ASP教程:4、ASP脚本基础
·ASP教程:3、ASP基础
·ASP教程:2、ASP简介
·ASP教程:1、Are you ready?
·ASP中使用SQL语句教程
·ASP进度条
·由HTTP 500 Internal server e
·Asp无组件生成缩略图
·ASP 系列函数大全(4)
·ASP 系列函数大全(3)
·ASP 系列函数大全(2)
Google
 
asp存贮过程
[ 作者:  加入时间:2007-12-03 15:38:32  来自:Linux联盟收集整理 ]
CREATE PROCEDURE login_verify sp6Linux联盟
  ( sp6Linux联盟
  @community_id int, --拿值 sp6Linux联盟
  @username varchar(20), sp6Linux联盟
  @password varchar(40), sp6Linux联盟
  @result tinyint output sp6Linux联盟
  ) sp6Linux联盟
   sp6Linux联盟
  AS sp6Linux联盟
   sp6Linux联盟
  set nocount ON sp6Linux联盟
   sp6Linux联盟
  declare @service_deadline_date smalldatetime,@community_setting_max_online_count int ---定义一个变量为 短日期格式 sp6Linux联盟
   sp6Linux联盟
  select @community_setting_max_online_count=community_setting_max_online_count,sp6Linux联盟
@service_deadline_date=service_deadline_date from community_info where community_id=@community_id --这里是求最大登录人数 sp6Linux联盟
   sp6Linux联盟
  if datediff(d,@service_deadline_date,getdate())>10 --其实这个是限制用户的使用期,求当前日期与库中的记录日期如时大于10天,则返回@result =11 sp6Linux联盟
  begin sp6Linux联盟
  set @result=11 --超过使用期 sp6Linux联盟
  return sp6Linux联盟
  end sp6Linux联盟
   sp6Linux联盟
  if (select count(*) from online_user where =@community_setting_max_online_count">community_id=@community_id)>=@community_setting_max_online_count --根据库中的记录设定与当前人数比较 sp6Linux联盟
  begin sp6Linux联盟
  set @result=10 --超出在线人数限制 --返回@result=10 sp6Linux联盟
  return sp6Linux联盟
  end sp6Linux联盟
   sp6Linux联盟
  declare @stamia int,@last_update_stamia_date smalldatetime,@level_id int --定义变量 整型 短日期型 整型 sp6Linux联盟
  declare @userid int ,@user_role int sp6Linux联盟
  select @userid=userid,@user_role=user_role,@stamia=stamia,@last_update_stamia_date=sp6Linux联盟
last_update_stamia_date,@level_id=level_id from user_info where username=@username and password=@password and community_id=@community_id and user_type=0 sp6Linux联盟
   sp6Linux联盟
  --从用户信息表中,将一些信息写入到定义的三个变量中 sp6Linux联盟
   sp6Linux联盟
  if @userid is not null ----如果@userid 不变null值 sp6Linux联盟
  begin --用户名和密码校验成功 sp6Linux联盟
  set @result=1 --检验成功 sp6Linux联盟
  return sp6Linux联盟
  end sp6Linux联盟
  else sp6Linux联盟
  begin sp6Linux联盟
  set @result=0 ---登录失败 sp6Linux联盟
  end sp6Linux联盟
   sp6Linux联盟
  set nocount OFF sp6Linux联盟
   sp6Linux联盟
  GO sp6Linux联盟
   sp6Linux联盟
  我们给上面的过程取个名login_verify叫做 sp6Linux联盟
   sp6Linux联盟
  写成是ASP代码中调用安全认证的地方 sp6Linux联盟
   sp6Linux联盟
  '''事先已经定义好conn sp6Linux联盟
   sp6Linux联盟
  Set cmd.ActiveConnection=conn sp6Linux联盟
  cmd.CommandText="login_verify" sp6Linux联盟
  cmd.CommandType=&H0004 sp6Linux联盟
   sp6Linux联盟
  @community_id int, --拿值 sp6Linux联盟
  @username varchar(20), sp6Linux联盟
  @password varchar(40), sp6Linux联盟
  @result int sp6Linux联盟
   sp6Linux联盟
  cmd.Parameters.Append cmd.CreateParameter("@community_id",3) sp6Linux联盟
  cmd.Parameters.Append cmd.CreateParameter("@username ",200) sp6Linux联盟
  cmd.Parameters.Append cmd.CreateParameter("@password",200) sp6Linux联盟
   sp6Linux联盟
  cmd("@community_id")=session("community_id") sp6Linux联盟
  cmd("@username")=request("userid") sp6Linux联盟
  cmd("@password")=request("userid") sp6Linux联盟
   sp6Linux联盟
  cmd.execute sp6Linux联盟
   sp6Linux联盟
  dim result sp6Linux联盟
   sp6Linux联盟
  result=cmd("@result") sp6Linux联盟
   sp6Linux联盟
  conn.close sp6Linux联盟
   sp6Linux联盟
  if trim(result)="1" then sp6Linux联盟
   sp6Linux联盟
   sp6Linux联盟
  '''''''''''''登录成功的提示与操作 sp6Linux联盟
  else sp6Linux联盟
   sp6Linux联盟
  ''''''''''''''''''''''登录失败的提示与操作 sp6Linux联盟
  end if sp6Linux联盟
Linux联盟收集整理 ,转贴请标明原始链接,如有任何疑问欢迎来本站Linux论坛讨论
评论】【加入收藏夹】【 】【打印】【关闭
※ 相关链接
 ·asp内置对象Application详解  (2007-12-03 15:38:01)
 ·自定义aspnet_client的位置  (2007-12-03 15:36:48)
 ·asp常见的错误及其解决方法  (2007-12-03 15:35:59)
 ·ASP.NET验证控件详解  (2007-12-03 15:34:17)
 ·ASP内置对象 Request对象详解  (2007-12-03 15:32:26)
 ·ASP 中 DateDiff 函数详解  (2007-12-03 15:31:44)
 ·Carello Web 使 ASP 源码暴露(APP,缺陷)-ASP漏洞集  (2007-12-03 15:27:29)
 ·给你的FileSystemObject对象加把锁-ASP漏洞集  (2007-12-03 15:26:53)
 ·MS IIS虚拟主机ASP源码泄露(MS,缺陷)-ASP漏洞集  (2007-12-03 15:26:16)
 ·通过asp入侵web server,窃取文件毁坏系统-ASP漏洞集  (2007-12-03 15:25:41)