'
)
--------------------------------------------------- ------------>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transisi//EN"
" http://www.w3.org/TR/html4/loose.dtd ">
<html>
<kepala>
<title>Dokumen Tanpa Judul</title>
<meta http-equiv="Jenis Konten" content="teks/html; charset=gb2312">
</kepala>
<tubuh>
<tabel lebar="770" border="0" align="center" cellpadding="0" Cellspacing="0">
<tr>
<td><form name="form1" method="post" action="send.asp">
<lebar tabel="100%" border="0" cellpadding="0" Cellspacing="0" bgcolor="#CCFFFF">
<tr>
<td height="20"><div align="center">发送消息</div></td>
</tr>
<tr>
<td><div align="tengah">
<textarea name="msg" cols="100" row="6"></textarea>
</div></td>
</tr>
<tr>
<td><div align="tengah">
<input type="kirim" nama="Kirim" value="Kirim">
<input type="reset" name="Kirim2" value="Reset">
</div></td>
</tr>
</tabel>
</form></td>
</tr>
</tabel>
</tubuh>
</html>
'//kirim.asp
<%
fungsi chan_time(shijian)'转换日期时间函数
s_tahun=tahun(shijian)
jika len(s_year)=2 maka s_year="20"&s_year
s_bulan=bulan(shijian)
jika s_bulan<10 maka s_bulan="0"&s_bulan
s_hari=hari(shijian)
jika s_day<10 maka s_day="0"&s_day
s_jam=jam(shijian)
jika s_jam<10 maka s_jam="0"&s_jam
s_menit=menit(shijian)
jika s_menit<10 maka s_menit="0"&s_menit
chan_time=s_tahun & s_bulan & s_hari & s_jam & s_menit
fungsi akhir
fungsi chan_data(shijian) '转换日期时间函数
s_tahun=tahun(shijian)
jika len(s_year)=2 maka s_year="20"&s_year
s_bulan=bulan(shijian)
jika s_bulan<10 maka s_bulan="0"&s_bulan
s_hari=hari(shijian)
jika s_day<10 maka s_day="0"&s_day
chan_data=s_tahun & s_bulan & s_hari
fungsi akhir
fungsi chan_file(shijian)'转换日期时间函数
s_bulan=bulan(shijian)
jika s_bulan<10 maka s_bulan="0"&s_bulan
s_hari=hari(shijian)
jika s_day<10 maka s_day="0"&s_day
s_jam=jam(shijian)
jika s_jam<10 maka s_jam="0"&s_jam
s_menit=menit(shijian)
jika s_menit<10 maka s_menit="0"&s_menit
s_ss=kedua(shijian)
jika s_ss<10 maka s_ss="0"&s_ss
chan_file = s_bulan & s_hari & s_jam & s_menit & s_ss
fungsi akhir
top="<html><head><title>berita</title></head><body>"
bawah="</body></html>"
pesan=permintaan.Formulir("pesan")
pesan=ganti(pesan,vbcrlf,"")
pesan=ganti(pesan,chr(9),"")
pesan=ganti(pesan," "," ")
pesan=ganti(pesan,"rn","<br>")
pesan=ganti(pesan,"n","<br>")
pesan=atas&pesan&bawah
Setel fs=Server.CreateObject("Scripting.FileSystemObject")
all_tree2=server.mappath("berita")&""&chan_data(sekarang)
if (fs.FolderExists(all_tree2)) maka'判断今天的文件夹是否存在
kalau tidak
fs.BuatFolder(semua_pohon2)
berakhir jika
lulus=chan_file(sekarang)
mengacak '使用系统计时器来初始化乱数产生器
lulus=rd(lulus)
lulus=dapatkan_pass(lulus)
lulus=kiri(lulus,10)
file1=lulus
file=file1&".txt"
filez=all_tree2&""&files
set ts = fs.createtextfile(filez,true) '写文件
untuk z=1 ke len(pesan)
write_now=pertengahan(pesan,z,1)
ts.tulis(tulis_sekarang)
Berikutnya
' ts.writeline(semua_pesan)
ts.tutup
set ts=nothing '文件生成
if err.number<>0 atau err maka%>
<skrip bahasa="javascript">
alert("不能完成")
</skrip>
<%lainnya%>
<skrip bahasa="javascript">
peringatan("已完成")
sejarah.kembali();
</skrip>
<%akhir jika
Setel File Saya = fs.GetFile(filez)
all_tree2=server.mappath("berita")&""&chan_data(sekarang)
jika (fs.FolderExists(all_tree2)) lalu
kalau tidak
fs.BuatFolder(semua_pohon2)
berakhir jika
NamaFile Saya.= kiri(NamaFile Saya,len(NamaFile Saya)-4)&".htm"
atur File Saya=tidak ada
atur fs=tidak ada
atur fdir=tidak ada
fungsi get_pass(lulus)
lulus=cstr(lulus)
lulus=ganti(lulus," ","")
lulus=ganti(lulus," ","")
lulus=ganti(lulus,"-","")
lulus=ganti(lulus," ","")
lulus=ganti(lulus,":","")
lulus=ganti(lulus,".","")
lulus=ganti(lulus,"+","")
lulus=ganti(lulus,"_","")
lulus=ganti(lulus,"<","")
lulus=ganti(lulus,">","")
lulus=ganti(lulus,"!","")
lulus=ganti(lulus,"@","")
lulus=ganti(lulus,"#","")
lulus=ganti(lulus,"$","")
lulus=ganti(lulus,"%","")
lulus=ganti(lulus,"^","")
lulus=ganti(lulus,"&","")
lulus=ganti(lulus,"*","")
lulus=ganti(lulus,"(","")
lulus=ganti(lulus,"")","")
lulus=ganti(lulus,"=","")
lulus=ganti(lulus,"","")
lulus=ganti(lulus,"/","")
lulus=ganti(lulus,"|","")
get_pass=melewati
fungsi akhir
%>
'//
把send.asp和index.htm放到你的ASP目录下,然后再建一个news文件夹。打开浏览器,在地址栏里输入:http://你的机器名/你的ASP虚拟目录名/index.html输入文字,然后提交,OK! layanan kesehatan文字,看看是不是生成了HTML文件。怎么样,你可以在此基础上做个简单的新闻发布系统。