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

我写的一个asp上传组件

  网上流传的种种asp上传类真是太烦琐了,我自己写了一个上传类。这个上传类体积很小,只适用于单文件上传,返回结果是一个json,格式为:{"err":"出错原因","msg":"上传文件的地址"},例如:{"err":"\u6587\u4EF6\u592A\u5927\u4E86\2C\u4E0A\u4F20\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7200K","msg":""}
或者{"err":"","msg":"uploadfile/201013/7897896786.zip"}
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%Option Explicit
Response.Buffer = True
response.charset = "gb2312"
Const uploadfolder="uploadpic"
Const allowExt="jpg,jpeg,gif,png,rar,doc,zip,xls,pdf,swf,avi,mp3,txt,htm,html"
Function BytestoStr(filestr)
dim skipflag : skipflag = 0
dim varlen,clow,i
dim content : content = ""
if not isnull(filestr) then
varlen = lenb(filestr)
for i=1 to varlen
if skipflag=0 then
clow = midb(filestr,i,1)
if ascb(clow) > 127 then
content = content & chr(ascw(midb(filestr,i+1,1) & clow))
skipflag = 1
else
content = content & chr(ascb(clow))
end if
else
skipflag = 0
end if
next
end if
BytestoStr = content
End Function
Function getFilepath(ext)
dim folderpath,fso,filename
folderpath=server.mappath(uploadfolder)
set fso=server.createobject("Scripting.FileSystemObject")
if Fso.FolderExists(folderpath)=false then fso.CreateFolder(folderpath)
folderpath=folderpath&"\"&replace(replace(date(),"/",""),"-","")
fileinfo=uploadfolder&date()
if Fso.FolderExists(folderpath)=false then fso.CreateFolder(folderpath)
filename=cstr(timer()*100)&"."&ext
getFilepath=folderpath&"\"&filename
fileinfo=fileinfo&"/"&filename
set Fso=nothing
End Function
Function CheckExt(fileinfo)
dim re
set re=new


相关文档:

ASP 多图片上传

1:上传页面
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="te ......

asp utf 8 头文件数据库联接池

 <%@Language="VBScript" CodePage="65001"%>
<% option explicit%>
<% on error resume next %>
<% Session.CodePage="65001" %>
<% response.charset="utf-8" %>
<%
dim conn,connstr,sql,rs,rs2,rs3
connstr="dbq=" & server.MapPath("../data091003/data09 ......

使用ASP发送飞信的免费短信

 使用ASP发送飞信的免费短信
     要实现在asp网站上发送飞信,要求是中国移动的手机用户,并且开通移动飞信功能。
     使用以下asp代码,修改参数为你的手机号及飞信密码,就可以实现在网站发免费短信功能。
    
fsend.asp文件源代码如下:
< ......

ASP错误信息解决方法

1.错误信息
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server 不存在或访问被拒绝
原因:
2005里似乎不支持“(local)”和“点”将其改为服务器的名称。
2000是可以的。所以不会出现这样的问题。
2.错误信息
错误类型一:
Mi ......

ASP 编程中 20 个非常有用的例子

1.如何用Asp判断你的网站的虚拟物理路径
答:使用Mappath方法
< p align="center" >< font size="4" face="Arial" >< b >
The Physical path to this virtual website is:
< /b >< /font >
< font color="#FF0000" size="6" face="Arial" >
< %= Server.MapPath("\")% >
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号