ASP中十大常用程序代码.:第七节〈我的心得〉
用ASP实现支持附件的EMail系统(1)
大家经常探讨使用asp,而不使用其他组建能否实现文件的上传,从而开发出支持邮件附件的邮件系统,答案是可以的。
以下是发送邮件的页面,邮件的帐号是员工号,假设是5位的数字,sendmail.asp当然是在合法登陆后才能够看到的
<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>邮件系统</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('请输入收件人!');
theform.geterempl.focus();
return false;
}
if (theform.emailtitle.value=='')
{
alert('请输入主题!');
theform.emailtitle.focus();
return false;
}
if (theform.emailtitle.value.length>200)
{
alert('主题请少于200字节');
theform.emailtitle.focus();
return false;
}
if (theform.body.value.length>15*1024)
{
alert('正文请少于16K');
theform.body.focus();
return false;
}
if (theform.emailshowname.value.length>1024)
{
alert('签名请少于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 ((get
相关文档:
只需要在fckeditor\editor\filemanager\connectors\asp文件夹下的commands.asp修改一下即可
在这个文件中查找一下:FileUpload
会找到这个函数
把
代码如下:
Dim sFilePath
sFilePath = CombineLocalPaths(sServerDir, sFileName)
改为
代码如下:
Dim sFilePath,ranNum
Randomize
ranNum=int(90000*rnd)+ ......
现在主流的网站开发语言无外乎asp、php、asp.net、jsp等。
网页从开始简单的hmtl到复杂的服务语言,走过了10多个年头,各种技术层出不穷,单个的主流技术也在不断翻新的版本,现在分析下各种语言的区别、优势、劣势、开发注意事项!
HTML:当然这是网页最基本的语言,每一个服务器语言都需要它的支持,要学习,这个肯定是开始 ......
<bgsound src="wen.mid" loop="0">
<% dim weh
If Time >=#1:00:00 AM# And Time < #6:00:00 PM# Then
weh = "<bgsound src="1.mid" loop="0">"
Else If Time >#6:00:00 AM# And Time < #9:00:00 PM#
weh = "<bg ......
用ASP编写网站应用程序时间长了,难免会遇到各式各样的问题,其中关于如何上传文件到服务器恐怕是遇见最多的问题了,尤其是上传图片,比如你想要在自己的社区里面实现类似网易虚拟社区提供的“每日一星”的功能,就要提供给网友上传照片的功能。上传图片文件到服务器可以使用各种免费的文件上传组件,使 ......
ASP(Active Server Pages)是Microsoft很早就推出的一种WEB应用程序解决方案,也是绝大多数从事网站开发人员很熟悉的一个比较简单的编程环境。通过ASP我们可以创建功能强大的动态的WEB应用程序。ASP虽然功能很强大,但有些功能用纯ASP代码完成不了,为了能保证开发出功能更加强大的WEB应用程序,我们可以借助调用COM组件。 ......