WEB开发网:用户注册册及确认在线的ASP程序。1. SQL的表及储存过程---------------------------------------------CREATE TABLE [dbo].[userb
赞助商链接
中资源
>> 最新文章
>> 赞助商
>> 热门文章
WEB开发网文章阅读

用户注册及跟踪代码(一)

作者:未知 文章来源:WEB开发者 更新时间:2007-12-9 13:31:06
用户注册册及确认在线的ASP程序。
1. SQL的表及储存过程
---------------------------------------------
CREATE TABLE [dbo].[userbaseinfo] (
    [userid] [varchar] (50) NOT NULL ,
    [password] [varchar] (50) NOT NULL ,
    [validcodelogin] [char] (50) NOT NULL ,
    [userlevel] [char] (1) NULL ,
    [logintime] [char] (50) NULL
) ON [Prima(最完善的虚拟主机管理系统)RY]
GO

alter table userbaseinfo
add
constraint PK_userbaseinfo_userid
    Prima(最完善的虚拟主机管理系统)ry key (userid)
Go

CREATE TABLE [dbo].[userdetailinfo] (
    [userid] [varchar] (50) NOT NULL ,
    [password] [varchar] (30) NOT NULL ,
    [realname] [varchar] (10) NULL ,
    [sex] [char] (10) NULL ,
    [birthday] [datetime] NULL ,
    [idcode] [varchar] (50) NULL ,
    [address] [varchar] (300) NULL ,
    [email] [varchar] (50) NULL ,
    [telephone] [varchar] (50) NULL
) ON [Prima(最完善的虚拟主机管理系统)RY]
GO

alter table userdetailinfo
add
constraint PK_userdetailinfo_userid
    Prima(最完善的虚拟主机管理系统)ry key (userid)
Go

SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

CREATE proc dbo.proc_GetRandom_internal
--取得校验码
    @minNum        integer,
    @maxNum        integer,
    @RandomNum    float output
as
set nocount on

declare @numRange integer
declare @ranSeed integer
declare @curTime  datetime

begin

  select @numRange=@maxNum-@minNum+1

  select @curTime=getdate()
  select @ranSeed=datediff(s,'2000-1-1',@curTime)  
  select @ranSeed=@ranSeed+1
  select @RandomNum=rand()*@numRange+@minNum
  --print @RandomNum
  return
end




GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO


CREATE proc dbo.proc_GetValidCode_Internal
--取得校验码
    @CodeLength    integer,
    @ValidCode    varchar(10) output
as
set nocount on

declare @chrRnd char(1)
declare @chrRndNo integer

begin

  select @ValidCode=""

  while (@CodeLength>0)
  begin
    exec proc_GetRandom_internal 1,52,@chrRndNo output
    if @chrRndNo>26
      begin
       select @chrRndNo=@chrRndNo+6
      end
    select @chrRnd=char(@chrRndNo+64)
    select @ValidCode=@ValidCode+@chrRnd
    select @CodeLength=@CodeLength-1

[1] [2] [3] [4]  下一页

百度搜索中共有相关主题
[阅读:次] [返回上一页] [打 印]
  • 相关文章
  • 本类热门