|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
ASP在国内异常流行,因为国内大多使用的是盗版的Windows和盗版的SQLServer,而ASP+COM+SQLServer实际上也是一种不错的搭配,其性能也不输于PHP+MYSQL,特别是Windows系统和SQLServer都有图形界面,比APACHE和MYSQL易于维护,因此对于不重视知识产权的国家来说也是一种不错的选择。<%
imgpath="company_01.jpg"
setpp=newimgInfo
w=pp.imgW(server.mappath(imgpath))
h=pp.imgH(server.mappath(imgpath))
setpp=nothing
response.write"<imgsrc="&imgpath&"border=0><br>宽:"&w&";高:"&h
ClassimgInfo
dimaso
PrivateSubClass_Initialize
setaso=CreateObject("Adodb.Stream")
aso.Mode=3
aso.Type=1
aso.Open
EndSub
PrivateSubClass_Terminate
err.clear
setaso=nothing
EndSub
PrivateFunctionBin2Str(Bin)
DimI,Str
ForI=1toLenB(Bin)
clow=MidB(Bin,I,1)
ifASCB(clow)<128then
Str=Str&Chr(ASCB(clow))
else
I=I+1
ifI<=LenB(Bin)thenStr=Str&Chr(ASCW(MidB(Bin,I,1)&clow))
endif
Next
Bin2Str=Str
EndFunction
PrivateFunctionNum2Str(num,base,lens)
dimret
ret=""
while(num>=base)
ret=(nummodbase)&ret
num=(num-nummodbase)/base
wend
Num2Str=right(string(lens,"0")&num&ret,lens)
EndFunction
PrivateFunctionStr2Num(str,base)
dimret
ret=0
fori=1tolen(str)
ret=ret*base+cint(mid(str,i,1))
next
Str2Num=ret
EndFunction
PrivateFunctionBinVal(bin)
dimret
ret=0
fori=lenb(bin)to1step-1
ret=ret*256+ascb(midb(bin,i,1))
next
BinVal=ret
EndFunction
PrivateFunctionBinVal2(bin)
dimret
ret=0
fori=1tolenb(bin)
ret=ret*256+ascb(midb(bin,i,1))
next
BinVal2=ret
EndFunction
PrivateFunctiongetImageSize(filespec)
dimret(3)
aso.LoadFromFile(filespec)
bFlag=aso.read(3)
selectcasehex(binVal(bFlag))
case"4E5089":
aso.read(15)
ret(0)="PNG"
ret(1)=BinVal2(aso.read(2))
aso.read(2)
ret(2)=BinVal2(aso.read(2))
case"464947":
aso.read(3)
ret(0)="GIF"
ret(1)=BinVal(aso.read(2))
ret(2)=BinVal(aso.read(2))
case"535746":
aso.read(5)
binData=aso.Read(1)
sConv=Num2Str(ascb(binData),2,8)
nBits=Str2Num(left(sConv,5),2)
sConv=mid(sConv,6)
while(len(sConv)<nBits*4)
binData=aso.Read(1)
sConv=sConv&Num2Str(ascb(binData),2,8)
wend
ret(0)="SWF"
ret(1)=int(abs(Str2Num(mid(sConv,1*nBits+1,nBits),2)-Str2Num(mid(sConv,0*nBits+1,nBits),2))/20)
ret(2)=int(abs(Str2Num(mid(sConv,3*nBits+1,nBits),2)-Str2Num(mid(sConv,2*nBits+1,nBits),2))/20)
case"FFD8FF":
do
dp1=binVal(aso.Read(1)):loopwhilep1=255andnotaso.EOS
ifp1>191andp1<196thenexitdoelseaso.read(binval2(aso.Read(2))-2)
dp1=binVal(aso.Read(1)):loopwhilep1<255andnotaso.EOS
loopwhiletrue
aso.Read(3)
ret(0)="JPG"
ret(2)=binval2(aso.Read(2))
ret(1)=binval2(aso.Read(2))
caseelse:
ifleft(Bin2Str(bFlag),2)="BM"then
aso.Read(15)
ret(0)="BMP"
ret(1)=binval(aso.Read(4))
ret(2)=binval(aso.Read(4))
else
ret(0)=""
endif
endselect
ret(3)="width="""&ret(1)&"""height="""&ret(2)&""""
getimagesize=ret
EndFunction
PublicFunctionimgW(pic_path)
Setfso1=server.CreateObject("Scripting.FileSystemObject")
If(fso1.FileExists(pic_path))Then
Setf1=fso1.GetFile(pic_path)
ext=fso1.GetExtensionName(pic_path)
selectcaseext
case"gif","bmp","jpg","png":
arr=getImageSize(f1.path)
imgW=arr(1)
endselect
Setf1=nothing
else
imgW=0
Endif
Setfso1=nothing
EndFunction
PublicFunctionimgH(pic_path)
Setfso1=server.CreateObject("Scripting.FileSystemObject")
If(fso1.FileExists(pic_path))Then
Setf1=fso1.GetFile(pic_path)
ext=fso1.GetExtensionName(pic_path)
selectcaseext
case"gif","bmp","jpg","png":
arr=getImageSize(f1.path)
imgH=arr(2)
endselect
Setf1=nothing
else
imgH=0
Endif
Setfso1=nothing
EndFunction
EndClass
%>
在实现ERP等高端的ASP应用时,用户需要提供核心的经营资料,需要ASP商有很高的信用度。楼上说交互性不好,太牵强了吧。在微软提供的一套框架中,利用asp做网站,开发效率高,使用人数少,减少不必要的开销。交互性是互动方式,是有开发人员决定的。 |
|