⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 class_user.asp

📁 STM32 Keil 下的驱动STM32 Keil 下的驱动
💻 ASP
📖 第 1 页 / 共 2 页
字号:
   end if
	rs.update
	rs.close
	set rs=nothing
elseif ty=3 then
   sql="delete * from CnwyAsp_admin where user='"&user&"'"
   conn.execute(sql)
   info="您成功的删除用户"&user&"的资料."
end if
Cnwy_Public.massage(info)
set Cnwy_public=nothing
Call Connclose()
End function
Public Function Mssave()       '用户邮件发送函数方法
dim sender,title,who,info,dx
dim rs,sql,fso,Cnwy_public,fli,fname
set Cnwy_public = new CnwyAsp_public
sender=request.cookies("user")
title=trim(request.form("title"))
who=trim(lcase(request.form("to")))
content=trim(request.form("content"))
Cnwy_public.checkstrvar=who
usermaildx=who
call connopen()
if title="" or who="" or content="" then
 info="请您把相关信息填写完整再进行发送."
elseif len(title)>100 then
 info="您的信息主题超过了100个字符."
elseif Cnwy_public.checknumer<>0 then
 info="对不起您输入的用户名中有非法字符."
elseif Cnwy_public.maildx=Mdx then
 info="对不起["&who&"]的信箱空间已满不能再次接受任何信件."
elseif  (Mdx+Lenb(content))>=Cnwy_public.maildx then
 info="对不起["&who&"]的信箱的剩余空间太少,无法接受你发的信息."
 

else
   sql="select * from CnwyAsp_admin where user='"&who&"'"
   set rs=conn.execute(sql)
   if not rs.eof or not rs.bof then
      rs.close
      fname=now()
	  fname=replace(replace(fname,"-","")," ","")
	  fname=replace(fname,":","")
	  fname=who&fname
	  fname=fname&".txt"
	  fname="massage/"&fname
	  set fso=server.createobject("scripting.filesystemobject")
	  set fli=fso.CreateTextFile(server.mappath(fname),true)
	  fli.writeline(content)
	  fli.close
	  set fli=nothing
	  set fli=fso.getfile(server.mappath(fname))
	  dx=fli.size
      set fli=nothing
	  set fso=nothing
     sql="select * from CnwyAsp_Massage "
	 set rs=server.createobject("adodb.recordset")
	 rs.open sql,conn,2,3
	 rs.addnew
	 rs("sender")=sender
	 rs("to")=who
	 rs("title")=title
	 rs("content")=fname
	 rs("date")=now()
	 rs("dx")=dx
	 rs.update
	 rs.close
	 set rs=nothing
	info="恭喜您信息发送成功."
  else
    info="您输入的用户帐号不存在.请您查验."
    rs.close
    set rs=nothing
  end if
end if
  Cnwy_public.massage(info)
  set Cnwy_public=nothing
  call connclose()
End Function
public function Msdel()      '信息删除方法
dim id,user,content,num
dim rs,sql,fso,fli,i,CnwyAsp_Public
set Cnwy_public=new CnwyAsp_Public
set fso=server.createobject("scripting.filesystemobject")
call connopen()
id=trim(request.querystring("id"))
user=request.cookies("user")
if id<>"" then
       if isnumeric(id) then
            sql="select * from CnwyAsp_Massage where id="&id
	        set rs=server.CreateObject("adodb.recordset")
			rs.open sql,conn,1,3
	         if not rs.eof and  not rs.bof then
	               if rs("sender")=user or rs("to")=user then
		               content=rs("content")
		               rs.delete
					   rs.update
					   rs.close
		               set fli=fso.getfile(server.mappath(content))
		               fli.delete
		               info="删除邮件成功."
		            else
		               info="你没有权限删除此邮件."
		            end if
	           else
	                info="你操作的信件已经被删除."
	          end if
       else
           info="大哥你歇歇吧.没有事情加我的QQ32940696聊聊."
      end if
else
  checked=trim(request.form("checked"))
  if instr(checked,",")=0 then
    checked=checked&","
  end if
  checked=replace(checked," ","")
  id=split(checked,",")
   num=ubound(id)
   for i=0 to num
     if id="" then 
	  exit for
	  end if
	 sql="select * from CnwyAsp_Massage where id="&id(i)
	 set rs=server.createobject("adodb.recordset")
	 rs.open sql,conn,1,3
	 content=rs("content")
	 rs.delete
	 rs.update
	 rs.close
	 set fli=fso.getfile(server.mappath(content))
	 fli.delete
	 next
	info="批量删除邮件操作成功."
end if
Cnwy_public.massage(info)
set rs=nothing
set fli=nothing
set fso=nothing
set Cnwy_Public=nothing
call connclose()
end function
public property let usermaildx(ByVal user)
call connopen()
dim sql,rs
maildx=0
sql="select * from CnwyAsp_Massage where to='"&user&"'"
set rs=conn.execute(sql)
if not rs.eof and not rs.bof then
    rs.movefirst
    do while not rs.eof
      maildx=maildx+rs("dx")
      rs.movenext
    loop
else 
maildx=0
end if
call connclose()
end property
public property get Mdx
Mdx=maildx
end property
Public Function CheckMaster(ByVal ty)
dim info,Cnwy_public
set Cnwy_public=new CnwyAsp_Public
select case ty
case 0
if request.cookies("type")<>"infoadmin"  then
info="对不起你超越了自己的权限."
end if
case 1
if request.cookies("type")<>"superadmin"  then
info="对不起你超越了自己的权限."
end if
case 2
if instr(request.cookies("master"),"A")=0 then
info="对不起你超越了自己的权限."
end if
case 3
if instr(request.cookies("master"),"B")=0 then
info="对不起你超越了自己的权限."
end if
case 4
if instr(request.cookies("master"),"C")=0 then
info="对不起你超越了自己的权限."
end if
end select
if info<>"" then
Cnwy_Public.errinfo(info)
end if
set Cnwy_Public=nothing
End Function
public function checkduty(ByVal ty)    '值班人员权限检验
 dim Cnwy_public,week
 week=weekday(now())
 set Cnwy_public=new CnwyAsp_Public
 if Cnwy_public.duty=true and ty="B" then
   sql="Select * from CnwyAsp_duty where shenpi='"&request.cookies("user")&"' and id="&week&""
  elseif Cnwy_public.duty=true and ty="C" then
    sql="select * from CnwyAsp_duty where shenhe='"&request.cookies("user")&"' and id="&week&""
  end if
 if  sql<>"" then
  set rs=conn.execute(sql)
    if rs.eof or rs.bof then
	 info="尊敬的["&request.cookies("user")&"]今天不轮您值班.您无权使用此功能."
	 rs.close
	 set rs=nothing
	end if
 end if
 if not isempty(info) then
   Cnwy_public.massage(info)
  end if
  set Cnwy_public=nothing 
end function
public function checktype(ByVal ty)
if ty="superadmin" then
response.write("超级管理员")
elseif ty="infoadmin" then
 response.write("信息管理员")
 end if 
 end function
 public function chkmaster(ByVal ty,master)
 dim str,Mstr,rstr
 rstr=""
 with response
 if ty="superadmin" then
  .write("超级管理权限")
  elseif ty="infoadmin" then
 if master<>"" then 
   str=array("A","B","C")
   Mstr=array("|编写权","|审批权","|审核权")
   for i=0 to ubound(str)
    if instr(master,str(i))<>0 then
	 rstr=rstr&Mstr(i)
   end if
   next
   .write rstr&"|"
  else
  .write("没有任何权限")
   end if
  end if
   end with
 end function
Private Sub Class_Terminate()
    End Sub
End class
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -