易截截图软件、单文件、免安装、纯绿色、仅160KB

无组件ASP文件上传源代码

记得在建立一个文件夹"updata"
saveannounce_upload.asp 上传页
------------------------------------
<html>
<head>
<style type="text/css
">
body {font-size:9pt;}
input {font-size:9pt;}
</style>
<title>文件上传</title>
</head>
<body>
<form name="form" method="post" action="saveannouce_upfile.asp" enctype="multipart/form-data" >
文件
<input type="file" name="file1" size=10>
<input type="submit" name="Submit" value="上传">
</form>
</body>
</html>
------------------------------------
saveannouce_upfile.asp 保存文件到服务器

------------------------------------
<!--#include FILE="upload.inc"-->
<html>
<head>
<title>文件上传</title>
</head>
<body>
<%
dim upload,file,formName,formPath
set upload=new upload_5xSoft ''建立上传对象
formPath=upload.form("filepath") ''在目录后加(/)
if right(formPath,1)<>"/" then formPath=formPath&"/"
for each formName in upload.file ''列出所有上传了的文件
set file=upload.file(formName) ''生成一个文件对象
if file.filesize<100 then
response.write "<font size=2>请先选择你要上传的文件 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>"
response.end
end if
if file.filesize>500*1000 then '设置上传文件大小为500K
response.write "<font size=2>文件大小超过了限制 500K [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>"
response.end
end if
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
file.SaveAs Server.mappath("updata\"&file.FileName) ''保存文件
end if
set file=nothing
next
set upload=nothing
response.write "<font size=2>文件上传成功 [ <a href=# o


相关文档:

ASP循环输出表格行tr的方法

  <%
for i=1 to rs.recordCount '变量i从1循环到数据库中的全部记录数
if (i mod 1 =1) then '每个tr即每行显示1个记录,可根据需要自行修改, 将左边的1修改为2即显示两行。
response.write "<tr align='center'>"
end if
%>
此处为要循环的内容
  <%if (i mod 1 = 0) then ......

asp添加数据记录写入,删除,查看实列

<!--#include file="conn.asp"-->
<%
if request.Form("username")="" or request.form("password")="" then
response.Write("<script>alert('您好,不能为空
');location.href='index.html';</script>")
end if
%>
<%
di ......

Asp ADODB.Stream对象的方法属性

Adodb.Stream是ADO的Stream对象,提供存取二进制数据或者文本流,从而实现对流的读、写和管理等操作.
有下列方法:
Cancel 方法
     使用方法如下
     Object.Cancel
    
说明:取消执行挂起的异步 Execute 或 Open 方法的调用。
Close  方法
......

简单的asp分词算法(正向最大匹配)

最近写站内搜索,所以研究了一下算法,该算法的原理如图显示。
以下是一个用asp写的简单的分词程序主要的代码,词库我已经用access建立好了。
如果要注重效率,MarLen的选取很是重要,否则效率会十分低下,这里MarLen我选取的是5。
 
dim faword : faword = ""
do while (len(fword) > 0)
tword = left(fwor ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号