国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
用ASP實(shí)現(xiàn)支持附件的EMail系統(tǒng)
大家經(jīng)常探討使用asp,而不使用其他組建能否實(shí)現(xiàn)文件的上傳,從而開(kāi)發(fā)出支持郵件附件的郵件系統(tǒng),答案是可以的。

  以下是發(fā)送郵件的頁(yè)面,郵件的賬號(hào)是員工號(hào),假設(shè)是5位的數(shù)字,sendmail.asp當(dāng)然是在合法登陸后才能夠看到的  
<html>  
<head>  
<meta  http-equiv="Content-Type"  content="text/html;  charset=gb2312">  
<link  rel="stylesheet"  type="text/css"  href="/css/FORUM.CSS">  
<style  type=text/css>  
<!--  
input  {  font-size:  9pt;  color:  #0011dd;  background-color:  #e9e9f9;  padding-top:  0px}  
select  {  font-size:  9pt;  color:  #0011dd;  background-color:  #e9e9f9;  padding-top:  0px}  
textarea  {  font-size:  9pt;  color:  #0011dd;  background-color:  #e9e9f9;  padding-top:  0px}  
-->  
</style>  
<title>郵件系統(tǒng)</title></head>  
<body  bgcolor="#FEF7ED">  
<script  language="javascript">  
<%  
if  session("myid")=""  or  len(session("myid"))<>5  then  
response.write  "window.open('nolog.asp',target='_top');"  
end  if  
%>  
function  check(theform)  
{  

if  (theform.geterempl.value=='')  
{  
alert('請(qǐng)輸入收件人!');  
theform.geterempl.focus();  
return  false;  
}  
if  (theform.emailtitle.value=='')  
{  
alert('請(qǐng)輸入主題!');  
theform.emailtitle.focus();  
return  false;  
}  
if  (theform.emailtitle.value.length>200)  
{  
alert('主題請(qǐng)少于200字節(jié)');  
theform.emailtitle.focus();  
return  false;  
}  
if  (theform.body.value.length>15*1024)  
{  
alert('正文請(qǐng)少于16K');  
theform.body.focus();  
return  false;  
}  
if  (theform.emailshowname.value.length>1024)  
{  
alert('簽名請(qǐng)少于1K');  
theform.emailshowname.focus();  
return  false;  
}  


}  
</script>  
<%  
meth=request.querystring("meth")  
if  meth=1  then  
geterempl=trim(request.querystring("geterempl"))  
emailtitle=trim(request.querystring("emailtitle"))  
elseif  meth=2  then  
mailid=trim(request.querystring("mailid"))  
set  conn=server.createobject("adodb.connection")  
conn.open  "DSN=;UID=;PWD="  
dsnpath="DSN=;UID=;PWD="  
set  rs=server.createobject("adodb.recordset")  


selectnew="select  *  from  t_mail  where  ((geterempl  like  '%"&session("myid")&"%'  or  deleempl  like  '%"&session("myid")&"%'  or  receempl  like  '%"&session("myid")&"%')and  (not  deleverempl  like  '%"&session("myid")&"%'))  and  mailid='"&mailid&"'  "  
rs.open  selectnew,dsnpath,3,3  
if  rs.bof  or  rs.eof  then  
%>  
<script  language="javascript">  
alert("您沒(méi)有查看這封郵件的權(quán)限!");  
window.history.back();  
</script>  
<%  
response.end  
else  
body=rs("body")  
emailtitle=rs("emailtitle")  
rs.close  
set  rs=nothing  
conn.close  
set  conn=nothing  
end  if  
end  if  
%>  
<Form  name="upload_file"  onSubmit="return  check(this)"  action="loadmail.asp"  method=post  enctype="multipart/form-data"  >  
<table  width="100%"  border="0"  cellspacing="2"  cellpadding="2">  
<tr>  
<td  width="11%">  
<div  align="right">發(fā)件人:</div>  
</td>  
<td  width="89%">  
<input  type="hidden"  name="senderempl"  value="<%=session("myid")%>">  
<%=session("myid")%>  </td>  
</tr>  
<tr>  
<td  width="11%">  
<div  align="right">收件人:</div>  
</td>  
<td  width="89%">  
<input  type="text"  name="geterempl"  size="40"  value="<%=geterempl%>">  
<input  type="checkbox"  name="emaillevel"  value="1"  style="background-color:  #FEF7ED">  
緊急信件  </td>  
</tr>  
<tr>  
<td  width="11%"  valign="top">  </td>  
<td  width="89%">發(fā)送多個(gè)人的時(shí)候可以使用"<font  color="#9999FF">|</font>"隔開(kāi),例如:<font  color="#3399FF">01234|01235|01236</font>,第一位和最后一位不需要"<font  color="#9999FF">|</font>"

<font  color="#FF0000">新功能</font>:您可以把信信直接發(fā)送給您設(shè)定的<a  href="group.asp">某用戶</a>,發(fā)送格式為:gr:組序號(hào),例如<font  color="#0099FF">gr:001</font></td>  
</tr>  
<tr>  
<td  width="11%">  
<div  align="right"></div>  
</td>  
<td  width="89%">  
<input  type="checkbox"  name="receempl"  value="1"  style="background-color:  #FEF7ED">  
保存一份到收藏夾[<font  color="#3399FF">選定此項(xiàng),則郵件發(fā)送到對(duì)方郵箱的同時(shí)發(fā)送到自己的收藏夾里</font>]</td>  
</tr>  
<tr>  
<td  width="11%"  valign="top">  </td>  
<td  width="89%">  </td>  
</tr>  
<tr>  
<td  width="11%"  align="right">  主題:</td>  
<td  width="89%">  
<input  type="text"  name="emailtitle"  size="60"  value="<%=emailtitle%>">  
</td>  
</tr>  
<tr>  
<td  width="11%"  valign="top">  
<div  align="right">正文:</div>  
</td>  
<td  width="89%">  
<TEXTAREA  name=body  rows=8  cols=60><%=body%></TEXTAREA>  
</td>  
</tr>  
<tr>  
<td  width="11%"  valign="top">  
<div  align="right">簽名:</div>  
</td>  
<td  width="89%">  
<textarea  name="emailshowname"  cols="30"  rows="6"><%=application(session("myid")&"_name")%></textarea>  
</td>  
</tr>  
<tr>  
<td  width="11%">  
<div  align="right">  
<input  type=hidden  name="FileUploadStart">  
附件1:  </div>  
</td>  
<td  width="89%">  
<input  type="file"  name="file_up"  size="50">  
</td>  
</tr>  
<tr>  
<td  width="11%">  
<div  align="right">附件2:</div>  
</td>  
<td  width="89%">  
<input  type="file"  name="file_up1"  size="50">  
</td>  
</tr>  
<tr>  
<td  width="11%">  
<div  align="right">附件3:</div>  
</td>  
<td  width="89%">  
<input  type="file"  name="file_up2"  size="50">  
<input  type=hidden  name="FileUploadEnd">  
</td>  
</tr>  
<tr>  
<td  width="11%">  
<div  align="right"></div>  
</td>  
<td  width="89%">  
<input  type=submit  value=確定  >  
</td>  
</tr>  
</table>  
</Form>  
</body>  
</html>

  不過(guò)這僅僅只是得到了發(fā)送者的ip地址和mac地址,而且禁止用戶自己更改自己ip地址的代碼,因?yàn)槲覀兊南到y(tǒng)是需要對(duì)個(gè)人修改ip的行為進(jìn)行禁止的。  

<%  
strIP  =  Request.ServerVariables("REMOTE_ADDR")  


Set  net  =  Server.CreateObject("wscript.network")  
Set  sh  =  Server.CreateObject("wscript.shell")  
sh.run  "%comspec%  /c  nbtstat  -A  "  &  strIP  &  "  >  c:\"  &  strIP  &  ".txt",0,true  
Set  sh  =  nothing  
Set  fso  =  createobject("scripting.filesystemobject")  
Set  ts  =  fso.opentextfile("c:\"  &  strIP  &  ".txt")  
macaddress  =  null  
Do  While  Not  ts.AtEndOfStream  
data  =  ucase(trim(ts.readline))  
If  instr(data,"MAC  ADDRESS")  Then  
macaddress  =  trim(split(data,"=")(1))  
Exit  Do  
End  If  
loop  
ts.close  
Set  ts  =  nothing  
fso.deletefile  "c:\"  &  strIP  &  ".txt"  
Set  fso  =  nothing  
GetMACAddress  =  macaddress  
strMac  =  GetMACAddress  
set  conn=server.CreateObject("adodb.connection")  
conn.open  "DSN=;UID=;PWD="  
dsnpath="DSN=;UID=;PWD="  
set  rs=server.CreateObject("adodb.recordset")  
sele="select  *  from  getmac  where  g_mac='"&strMac&"'"  

rs.open  sele,dsnpath  
if  rs.bof  then  
set  conn=server.CreateObject("adodb.connection")  
conn.open  "DSN=;UID=;PWD="  
dsnpath="DSN=;UID=;PWD="  
set  rs=server.CreateObject("adodb.recordset")  
g_id=mid(strIP,9)  
g_id=left(g_id,2)  
'response.write  g_id  
if  isnumeric(g_id)  then  
g_id=cint(g_id)  
else  
g_id=0  
end  if  
sele="insert  into  getmac(g_ip,g_mac,g_id,g_ok)  values('"&strIP&"','"&strMac&"',"&g_id&",0)"  
rs.open  sele,dsnpath  
else  
set  conn=server.CreateObject("adodb.connection")  
conn.open  "DSN=;UID=;PWD="  
dsnpath="DSN=;UID=;PWD="  
set  rs=server.CreateObject("adodb.recordset")  

sele="select  *  from  getmac  where  g_ip='"&trim(strIP)&"'  and  g_mac='"&trim(strMac)&"'"  
rs.open  sele,dsnpath  

if  rs.bof  or  rs.eof  then  
set  rs1=server.CreateObject("adodb.recordset")  
sele="insert  into  badmac(ip,  mac  ,thetime)  values('"&strIP&"','"&strMac&"','"&now()&"')"  
rs1.open  sele,dsnpath  
response.redirect("/reg/wrong.asp")  
response.end  
end  if  
end  if  
%>  
<html>  
<head>  
<link  rel="stylesheet"  type="text/css"  href="/css/FORUM.CSS">  
<style  type=text/css>  
<!--  
input  {  font-size:  9pt;  color:  #0011dd;  background-color:  #e9e9f9;  padding-top:  0px}  
select  {  font-size:  9pt;  color:  #0011dd;  background-color:  #e9e9f9;  padding-top:  0px}  
textarea  {  font-size:  9pt;  color:  #0011dd;  background-color:  #e9e9f9;  padding-top:  0px}  
-->  
</style>  
<title>郵件系統(tǒng)</title></head><body  bgcolor="#FEF7ED">  
<%  
Response.Expires=0  
Function  bin2str(binstr)  
Dim  varlen,clow,ccc,skipflag  

skipflag=0  
ccc  =  ""  
If  Not  IsNull(binstr)  Then  
varlen=LenB(binstr)  
For  i=1  To  varlen  
If  skipflag=0  Then  
clow  =  MidB(binstr,i,1)  
If  AscB(clow)  >  127  Then  
ccc  =ccc  &  Chr(AscW(MidB(binstr,i+1,1)  &  clow))  
skipflag=1  
Else  
ccc  =  ccc  &  Chr(AscB(clow))  
End  If  
Else  
skipflag=0  
End  If  
Next  
End  If  
bin2str  =  ccc  
End  Function  


varByteCount  =  Request.TotalBytes  
'response.write  varbytecount  

bnCRLF  =  chrB(  13  )  &  chrB(  10  )  

binHTTPHeader=Request.BinaryRead(varByteCount)  

'response.write  vbenter  
'response.write  "

"&  cstr(binhttpheader)  &"

"  


sread=0  
eread=0  


'開(kāi)始讀非文件域的數(shù)據(jù)  
set  conn  =  Server.CreateObject("ADODB.Connection")  
conn.open  "DSN=;UID=;PWD="  

SQL="select  *  from  t_mail  where  mailid=0"  
set  rs=server.CreateObject("ADODB.Recordset")  
rs.Open  sql,conn,3,3  
rs.addnew  
rs("emaillevel")=0  
rs("receempl")=""  
Do  while  lenB(binHTTPHeader)>46  

Divider  =  LEFTb(  binHTTPHeader,  INSTRB(  binHTTPHeader,  bnCRLF  )  -  1  )  
binHeaderData  =  Leftb(binHTTPHeader,  INSTRB(  binHTTPHeader,  bnCRLF  &  bnCRLF  )-1)  
strHeaderData=bin2str(binHeaderData)  

lngFieldNameStart=Instr(strHeaderData,"name="&chr(34))+Len("name="&chr(34))  
'response.write  "
lngfieldnamestart:"&lngfieldnamestart  
lngFieldNameEnd=Instr(lngFieldNameStart,strHeaderData,chr(34))  
'response.write  "
lngfieldnameEND:"&lngfieldnameEND  


strFieldName=Mid(strHeaderData,lngFieldNameStart,lngFieldNameEnd-lngFieldNameStart)  

'RESPOnSE.WRITE  "<BR>STRFIELDNAME:"  &  STRfieldname  


strFieldName=Trim(strFieldName)  


strFieldName=Replace(strFieldName,vbcrlf,vbnullstring)  

'判斷文件數(shù)據(jù)時(shí)候開(kāi)始  

If  strComp(strFieldName,"FileUploadStart",1)=0  and  sread=0  Then  
'response.write  "找到了文件開(kāi)始的地方"  
sread=1  
'response.write  "
"  &  INSTRB(  DataStart  +  1,  binHTTPHeader,  divider  )  &"
"  
binHTTPHeader=MIDB(binHTTPHeader,INSTRB(  DataStart  +  1,  binHTTPHeader,  divider  ))  
exit  do  
End  if  
DataStart  =  INSTRB(  binHTTPHeader,  bnCRLF  &  bnCRLF  )  +  4  
DataEnd  =  INSTRB(  DataStart  +  1,  binHTTPHeader,  divider  )  -  DataStart  

binFieldValue=MIDB(  binHTTPHeader,  DataStart,  DataEnd  )  
strFieldValue=bin2str(binFieldValue)  

'strFieldValue=Trim(strFieldValue)  

strFieldValue=Replace(strFieldValue,"  ","  ")  

'非文件上傳域變量賦值  
'execute  strFieldName&"="""&strFieldValue&""""  
'response.write  strFieldName&":"&strFieldValue&"
"  

if  strfieldname="geterempl"  then  
strFieldValue=Replace(strFieldValue,vbcrlf,vbnullstring)  
if  instr(strfieldvalue,"gr:")=1  then  
'郵件組發(fā)  

'response.write  len(trim(strfieldvalue))  
if  len(trim(strfieldvalue))<>6  then  
'格式錯(cuò)誤返回  
%>  

嘗試發(fā)送郵件,但是失敗了,請(qǐng)修改錯(cuò)誤后重試!  
<script  language="javascript">  
alert("您輸入的收件組格式錯(cuò)誤!\r正確的格式是:'gr:001'");  
history.back();  
</script>  
<p>  
<%  
response.end  
else  
if  not  isnumeric(mid(trim(strfieldvalue),4))  then  
'格式錯(cuò)誤返回  
%>

  嘗試發(fā)送郵件,但是失敗了,請(qǐng)修改錯(cuò)誤后重試!  

<script  language="javascript">  
alert("您輸入的收件組格式錯(cuò)誤!\r正確的格式是:'gr:001'");  
history.back();  
</script>  
<p>  
<%  
response.end  
else  
thegroup=(mid(trim(strfieldvalue),4))  
end  if  
end  if  

tmpSQL="select  *  from  t_group  where  owner='"&session("myid")&"'  and  groupidowner='"&thegroup&"'"  
'response.write  tmpsql  
set  tmprs=server.CreateObject("ADODB.Recordset")  
tmprs.Open  tmpsql,conn  
if  tmprs.bof  or  tmprs.eof  then  
'沒(méi)有找到該組  
%>  
嘗試發(fā)送郵件,但是失敗了,請(qǐng)修改錯(cuò)誤后重試!  
<script  language="javascript">  
alert("您輸入的收件組<%=thegroup%>沒(méi)有找到!");  
history.back();  
</script>  
<p>  
<%  
response.end  
else  
if  tmprs("personnum")=0  then  
'組內(nèi)沒(méi)有用戶  
%>  
嘗試發(fā)送郵件,但是失敗了,請(qǐng)修改錯(cuò)誤后重試!  
<script  language="javascript">  
alert("您輸入的收件組<%=thegroup%>中目前沒(méi)有任何的用戶\n所以不能發(fā)送");  
history.back();  
</script>  
<p>  
<%  
response.end  
else  
strFieldValue=trim(tmprs("groupempl"))  
tmprs.close  
set  tmprs=nothing  
end  if  
end  if  
end  if  

if  instr(strfieldValue,"|")  then  
'組發(fā)  
allsearch=replace(trim(strfieldValue),"|","','")  
allsearch="'"&allsearch&"'"  
tmpstring=trim(strfieldValue)&"|"  
tosearch=""  
do  while  len(tmpstring)>=5  

tosearch=left(tmpstring,5)  
tmpstring=mid(tmpstring,7)  
if  instr(tosearch,"|")  then  
'格式錯(cuò)誤  
%>  
嘗試發(fā)送郵件,但是失敗了,請(qǐng)修改錯(cuò)誤后重試!  
<script  language="javascript">  
alert("您輸入的收件人格式錯(cuò)誤!");  
history.back();  
</script>  
<p>  
<%  
response.end  
end  if  

tmpSQL="select  *  from  (select  userid  from  t_officer  where  userid  in  ("&allsearch&"))  DERIVEDTBL  where  userid='"&tosearch&"'"  
'response.write  tmpsql  
set  tmprs=server.CreateObject("ADODB.Recordset")  
tmprs.Open  tmpsql,conn  
if  tmprs.eof  or  tmprs.bof  then  
%>  
嘗試發(fā)送郵件,但是失敗了,請(qǐng)修改錯(cuò)誤后重試!  
<script  language="javascript">  
alert("您輸入的收件人<%=tosearch%>沒(méi)有找到!");  
history.back();  
</script>  
<p>  
<%  
response.end  
end  if  
tmprs.close  
set  tmprs=nothing  
loop  
strfieldValue=trim(strFieldValue)  

else  
if  len(trim(strFieldValue))<>5  then  
'格式不正確  
%>  
嘗試發(fā)送郵件,但是失敗了,請(qǐng)修改錯(cuò)誤后重試!  
<script  language="javascript">  
alert("您輸入的收件人<%=trim(strFieldValue)%>不正確!");  
history.back();  
</script>  
<p>  
<%  
response.end  
else  
if  isnumeric(trim(len(strFieldValue)))  then  


tmpSQL="select  *  from  t_officer  where  userid='"&trim(strFieldValue)&"'"  

set  tmprs=server.CreateObject("ADODB.Recordset")  
tmprs.Open  tmpsql,conn  
if  tmprs.eof  or  tmprs.bof  then  
%>  
嘗試發(fā)送郵件,但是失敗了,請(qǐng)修改錯(cuò)誤后重試!  
<script  language="javascript">  
alert("您輸入的收件人<%=trim(strFieldValue)%>沒(méi)有找到\r該員工可能還沒(méi)有注冊(cè)!");  
history.back();  
</script>  
<p>  
<%  
response.end  
end  if  
tmprs.close  
set  tmprs=nothing  


strfieldValue=trim(strFieldValue)  
else  
%>  
嘗試發(fā)送郵件,但是失敗了,請(qǐng)修改錯(cuò)誤后重試!  
<script  language="javascript">  
alert("您輸入的收件人<%=trim(strFieldValue)%>不正確!");  
history.back();  
</script>  

<p>  <%  
response.end  
end  if  
end  if  
end  if  

end  if  
strFieldValue=replace(strFieldValue,"<","<")  
'response.write  strfieldname  
rs(STRFIELDNAME)=replace(strFieldValue,">",">")  

binHTTPHeader=MIDB(binHTTPHeader,INSTRB(  DataStart  +  1,  binHTTPHeader,  divider  ))  

loop  
'開(kāi)始處理文件數(shù)據(jù)  


titem=0  
rs("filesize_1")=0  
rs("filesize_2")=0  
rs("filesize_3")=0  



Do  while  lenB(binHTTPHeader)>46  

if  INSTRB(  binHTTPHeader,  bnCRLF  &  bnCRLF  )<>0  then  
binHeaderData  =  LeftB(binHTTPHeader,INSTRB(  binHTTPHeader,  bnCRLF  &  bnCRLF  )-1)  
else  
exit  do  
end  if  
strHeaderData=bin2str(binHeaderData)  


'讀取上傳文件的Content-Type  
lngFileContentTypeStart=Instr(strHeaderData,"Content-Type:")+Len("Content-Type:")  
strFileContentType=Trim(Mid(strHeaderData,lngFileContentTypeStart))  
strFileContentType=Replace(strFileContentType,vbCRLF,vbNullString)  

'讀取上傳的文件名  
if  instr(strheaderdata,"filename=")>0  then  
lngFileNameStart=Instr(strHeaderData,"filename="&chr(34))+Len("filename="&chr(34))  
lngFileNameEnd=Instr(lngFileNameStart,strHeaderData,chr(34))  
strFileName=Mid(strHeaderData,lngFileNameStart,lngFileNameEnd-lngFileNameStart)  
strFileName=Trim(strFileName)  
strFileName=Replace(strFileName,vbCRLF,vbNullString)  
else  
strfilename=""  
end  if  

'讀取上傳文件數(shù)據(jù)  
DataStart  =  INSTRB(  binHTTPHeader,  bnCRLF  &  bnCRLF  )  +  4  
DataEnd  =  INSTRB(  DataStart  +  1,  binHTTPHeader,  divider  )  -  DataStart  

If  strFileName<>""  Then  
if  dataend>0  then  
binFieldValue=MIDB(  binHTTPHeader,  DataStart,  DataEnd  )  
'將上傳的文件寫(xiě)入數(shù)據(jù)庫(kù)  
titem=titem+1  
'response.write  "titem:"&titem  
rs("FileContentType_"&titem)=strFileContentType  
rs("FileContent_"&titem).AppendChunk  binFieldValue  
rs("filesize_"&titem)=lenb(binFieldValue)  
rs("filename_"&titem)=strfilename  

else  
binfieldvalue=binhttpheader  
end  if  

End  if  

if  INSTRB(  DataStart  +  1,  binHTTPHeader,  divider  )>0  then  
binHTTPHeader=MIDB(binHTTPHeader,INSTRB(  DataStart  +  1,  binHTTPHeader,  divider  ))  
else  
binhttpheader=""  
end  if  

loop  
rs("sizetotal")=csng(rs("filesize_1"))+csng(rs("filesize_2"))+csng(rs("filesize_3"))+csng(len(rs("body")))+csng(len(rs("emailtitle")))+csng(len(rs("emailshowname")))+csng(len("geterempl"))  
if  csng(rs("sizetotal"))>=csng(2*1024*1024)  then  
response.write  "對(duì)不起,文件太大,請(qǐng)保證每封郵件的總大小不超過(guò)2M!"  
response.end  
end  if  
rs("mailtime")=now  
rs("readerempl")=""  
if  rs("receempl")<>""  then  
rs("receempl")=session("myid")  
rs("readerempl")=session("myid")  
end  if  
rs("deleempl")=""  
rs("deleverempl")=""  
rs("sendmac")=strmac  
rs.update  
rs.close  
set  rs=Nothing  
conn.Close  
set  conn=Nothing  

%>  
<script  language=javascript>  
window.open("mailok.asp",target="_self")  
</script>  
</body></html>  

  最后,我們來(lái)講講如何把內(nèi)容從數(shù)據(jù)庫(kù)中讀出來(lái),內(nèi)容有這么幾類(lèi),一類(lèi)是瀏覽器上可以顯示的,例如*.htm,一類(lèi)是需要下載的,例如*.exe,還有一種是瀏覽器可以顯示但是不能夠讓他顯示的,例如*.asp,請(qǐng)看代碼:  

<%  
Response.Buffer=  true  
Response.Clear  

function  getname(oriname)  
thename=oriname  
do  while  instr(thename,"/")>0  
thename=mid(thename,instr(thename,"/")+1)  
loop  
do  while  instr(thename,"\")>0  
thename=mid(thename,instr(thename,"\")+1)  
loop  
getname=thename  

end  function  

function  canexec(thechar)  
if  instr(thechar,".asp")>0  then  
canexec=false  
exit  function  
end  if  
if  instr(thechar,".asa")>0  then  
canexec=false  
exit  function  
end  if  
if  instr(thechar,".aspx")>0  then  
canexec=false  
exit  function  
end  if  
if  instr(thechar,".asax")>0  then  
canexec=false  
exit  function  
end  if  
canexec=true  
end  function  
mailID=request("mailID")  
se=request("se")  
if  se<>1  and  se<>2  and  se<>3  then  
response.end  
end  if  
Set  conn=server.createobject("adodb.connection")  
set  rs=server.createobject("adodb.recordset")  
conn.open  "DSN=;UID=;PWD="  
sql="select  *  from  t_mail  where  ((geterempl  like  '%"&session("myid")&"%'  or  deleempl  like  '%"&session("myid")&"%'  or  receempl  like  '%"&session("myid")&"%'  )  and  (not  deleverempl  like  '%"&session("myid")&"%'))  and  mailid='"&mailid&"'  "  
rs.open  sql,conn,3,3  
if  rs.eof  or  rs.bof  then  
response.end  
end  if  
if  rs("filecontenttype_"&trim(se))<>"text/plain"  or  (not  canexec(getname(trim(rs("filename_"&trim(se))))))  then  
Response.ContentType  =  rs("FileContentType_"&trim(se))  
end  if  



'Response.AddHeader  "content-type","application/x-msdownload"  

if  instr(response.contenttype,"application")>0  then  
response.AddHeader  "Content-Disposition","attachment;filename="&getname(trim(rs("filename_"&trim(se))))  
end  if  
Response.BinaryWrite  rs("FileContent_"&trim(se))  
rs.close  
set  rs=Nothing  
conn.close  
set  conn=nothing  
%>  

  文章到這里就結(jié)束了,至于郵件數(shù)據(jù)庫(kù)的數(shù)據(jù)結(jié)構(gòu)大家根據(jù)代碼自己琢磨吧!
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
Asp多表單域無(wú)組件文件上傳的例子
asp excel sql 關(guān)系大總結(jié) - 中軟網(wǎng)博客
整理了一些初學(xué)者常用的ASP代碼
使用VB將ASP代碼封裝生成DLL文件
asp代碼實(shí)現(xiàn)EXCEL數(shù)據(jù)導(dǎo)入到SQL數(shù)據(jù)庫(kù)
用ASP上傳Excel 表格并導(dǎo)入到數(shù)據(jù)庫(kù)
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服