仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 524|回复: 9
打印 上一主题 下一主题

[学习教程] ASP教程之对文件的操纵--创建挪动删除文件夹

[复制链接]
若天明 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-16 22:57:11 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
缺点:安全性不是太差了,还行,只要你充分利用系统自带的工具;唯一缺点就是执行效率慢,如何进行网站优化以后,效果会比较好。
上面两个文件:
<!--#includevirtual="/intels/chunfeng/graphicdetect.asp"-->
<html>
<head>
<TITLE>图象尺寸</TITLE>
</head>
<bodybgcolor="#FFFFFF">
<%
graphic="images/intels.gif"
HW=ReadImg(graphic)
Response.Writegraphic&"Dimensions:"&HW(0)&"x"&HW(1)
&"<br>"
response.write"<imgsrc=""/"&graphic&""""
response.writeheight="""&HW(0)&"""
response.writewidth="""&HW(0)&"">"
%>
</body>
</html>
------------------------
graphicdetect.asp
<%
DimHW
FunctionAscAt(s,n)
AscAt=Asc(Mid(s,n,1))
EndFunction
FunctionHexAt(s,n)
HexAt=Hex(AscAt(s,n))
EndFunction
FunctionisJPG(fichero)
IfinStr(uCase(fichero),".JPG")0Then
isJPG=true
Else
isJPG=false
EndIf
EndFunction
FunctionisPNG(fichero)
IfinStr(uCase(fichero),".PNG")0Then
isPNG=true
Else
isPNG=false
EndIf
EndFunction
FunctionisGIF(fichero)
IfinStr(uCase(fichero),".GIF")0Then
isGIF=true
Else
isGIF=false
EndIf
EndFunction
FunctionisBMP(fichero)
IfinStr(uCase(fichero),".BMP")0Then
isBMP=true
Else
isBMP=false
EndIf
EndFunction
FunctionisWMF(fichero)
IfinStr(uCase(fichero),".WMF")0Then
isWMF=true
Else
isWMF=false
EndIf
EndFunction
FunctionisWebImg(f)
IfisGIF(f)OrisJPG(f)OrisPNG(f)OrisBMP(f)OrisWMF(f)
Then
isWebImg=true
Else
isWebImg=true
EndIf
EndFunction
FunctionReadImg(fichero)
IfisGIF(fichero)Then
ReadImg=ReadGIF(fichero)
Else
IfisJPG(fichero)Then
ReadImg=ReadJPG(fichero)
Else
IfisPNG(fichero)Then
ReadImg=ReadPNG(fichero)
Else
IfisBMP(fichero)Then
ReadImg=ReadPNG(fichero)
Else
IfisWMF(fichero)Then
ReadImg=ReadWMF(fichero)
Else
ReadImg=Array(0,0)
EndIf
EndIf
EndIf
EndIf
EndIf
EndFunction
FunctionReadJPG(fichero)
Dimfso,ts,s,HW,nbytes
HW=Array("","")
Setfso=CreateObject("Scripting.FileSystemObject")
Setts=fso.OpenTextFile(Server.MapPath("/"&fichero),1)
s=Right(ts.Read(167),4)
HW(0)=HexToDec(HexAt(s,3)&HexAt(s,4))
HW(1)=HexToDec(HexAt(s,1)&HexAt(s,2))
ts.Close
ReadJPG=HW
EndFunction
FunctionReadPNG(fichero)
Dimfso,ts,s,HW,nbytes
HW=Array("","")
Setfso=CreateObject("Scripting.FileSystemObject")
Setts=fso.OpenTextFile(Server.MapPath("/"&fichero),1)
s=Right(ts.Read(24),8)
HW(0)=HexToDec(HexAt(s,3)&HexAt(s,4))
HW(1)=HexToDec(HexAt(s,7)&HexAt(s,8))
ts.Close
ReadPNG=HW
EndFunction
FunctionReadGIF(fichero)
Dimfso,ts,s,HW,nbytes
HW=Array("","")
Setfso=CreateObject("Scripting.FileSystemObject")
Setts=fso.OpenTextFile(Server.MapPath("/"&fichero),1)
s=Right(ts.Read(10),4)
HW(0)=HexToDec(HexAt(s,2)&HexAt(s,1))
HW(1)=HexToDec(HexAt(s,4)&HexAt(s,3))
ts.Close
ReadGIF=HW
EndFunction

FunctionReadWMF(fichero)
Dimfso,ts,s,HW,nbytes
HW=Array("","")
Setfso=CreateObject("Scripting.FileSystemObject")
Setts=fso.OpenTextFile(Server.MapPath("/"&fichero),1)
s=Right(ts.Read(14),4)
HW(0)=HexToDec(HexAt(s,2)&HexAt(s,1))
HW(1)=HexToDec(HexAt(s,4)&HexAt(s,3))
ts.Close
ReadWMF=HW
EndFunction
FunctionReadBMP(fichero)
Dimfso,ts,s,HW,nbytes
HW=Array("","")
Setfso=CreateObject("Scripting.FileSystemObject")
Setts=fso.OpenTextFile(Server.MapPath("/"&fichero),1)
s=Right(ts.Read(24),8)
HW(0)=HexToDec(HexAt(s,4)&HexAt(s,3))
HW(1)=HexToDec(HexAt(s,8)&HexAt(s,7))
ts.Close
ReadBMP=HW
EndFunction
FunctionisDigit(c)
IfinStr("0123456789",c)0Then
isDigit=true
Else
isDigit=false
EndIf
EndFunction
FunctionisHex(c)
IfinStr("0123456789ABCDEFabcdef",c)0Then
isHex=true
Else
ishex=false
EndIf
EndFunction
FunctionHexToDec(cadhex)
Dimn,i,ch,decimal
decimal=0
n=Len(cadhex)
Fori=1Ton
ch=Mid(cadhex,i,1)
IfisHex(ch)Then
decimal=decimal*16
IfisDigit(c)Then
decimal=decimal+ch
Else
decimal=decimal+Asc(uCase(ch))-Asc("A")
EndIf
Else
HexToDec=-1
EndIf
Next
HexToDec=decimal
EndFunction
%>

对用户来说可预见费用、节约费用,可以做到花少钱办大事。由于省去了购买软件和硬件等的前期费用,用户可以租用较高级的应用软件。ASP的收费是根据软件的类型、客制化程度、用户数量、服务期限来定的,对客户来说这笔费用是可以预见的。方便于客户应用软件的升级。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-6-9 11:20

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表