|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
因为现在数据库都使用标准的SQL语言对数据库进行管理,所以如果是标准SQL语言,两者基本上都可以通用的。SQLServer还有更多的扩展,可以用存储过程,数据库大小无极限限制。fso
<%
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::BMP,GIF,JPGandPNG:::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::
:::Thisfunctiongetsaspecifiednumberofbytesfromany:::
:::file,startingattheoffset(base1):::
::::::
:::Passed::::
:::flnm=>Filespecoffiletoread:::
:::offset=>Offsetatwhichtostartreading:::
:::bytes=>Howmanybytestoread:::
::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
functionGetBytes(flnm,offset,bytes)
DimobjFSO
DimobjFTemp
DimobjTextStream
DimlngSize
onerrorresumenext
SetobjFSO=CreateObject("Scripting.FileSystemObject")
First,wegetthefilesize
SetobjFTemp=objFSO.GetFile(flnm)
lngSize=objFTemp.Size
setobjFTemp=nothing
fsoForReading=1
SetobjTextStream=objFSO.OpenTextFile(flnm,fsoForReading)
ifoffset>0then
strBuff=objTextStream.Read(offset-1)
endif
ifbytes=-1thenGetAll!
GetBytes=objTextStream.Read(lngSize)ReadAll
else
GetBytes=objTextStream.Read(bytes)
endif
objTextStream.Close
setobjTextStream=nothing
setobjFSO=nothing
endfunction
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::
:::Functionstoconverttwobytestoanumericvalue(long):::
:::(bothlittle-endianandbig-endian):::
::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
functionlngConvert(strTemp)
lngConvert=clng(asc(left(strTemp,1))+((asc(right(strTemp,1))*256)))
endfunction
functionlngConvert2(strTemp)
lngConvert2=clng(asc(right(strTemp,1))+((asc(left(strTemp,1))*256)))
endfunction
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::
:::Thisfunctiondoesmostoftherealwork.Itwillattempt:::
:::toreadanyfile,regardlessoftheextension,andwill:::
:::identifyifitisagraphicalimage.:::
::::::
:::Passed::::
:::flnm=>Filespecoffiletoread:::
:::width=>widthofimage:::
:::height=>heightofimage:::
:::depth=>colordepth(innumberofcolors):::
:::strImageType=>typeofimage(e.g.GIF,BMP,etc.):::
::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
functiongfxSpex(flnm,width,height,depth,strImageType)
dimstrPNG
dimstrGIF
dimstrBMP
dimstrType
strType=""
strImageType="(unknown)"
gfxSpex=False
strPNG=chr(137)&chr(80)&chr(78)
strGIF="GIF"
strBMP=chr(66)&chr(77)
strType=GetBytes(flnm,0,3)
ifstrType=strGIFthenisGIF
strImageType="GIF"
Width=lngConvert(GetBytes(flnm,7,2))
Height=lngConvert(GetBytes(flnm,9,2))
Depth=2^((asc(GetBytes(flnm,11,1))and7)+1)
gfxSpex=True
elseifleft(strType,2)=strBMPthenisBMP
strImageType="BMP"
Width=lngConvert(GetBytes(flnm,19,2))
Height=lngConvert(GetBytes(flnm,23,2))
Depth=2^(asc(GetBytes(flnm,29,1)))
gfxSpex=True
elseifstrType=strPNGthenIsPNG
strImageType="PNG"
Width=lngConvert2(GetBytes(flnm,19,2))
Height=lngConvert2(GetBytes(flnm,23,2))
Depth=getBytes(flnm,25,2)
selectcaseasc(right(Depth,1))
case0
Depth=2^(asc(left(Depth,1)))
gfxSpex=True
case2
Depth=2^(asc(left(Depth,1))*3)
gfxSpex=True
case3
Depth=2^(asc(left(Depth,1)))8
gfxSpex=True
case4
Depth=2^(asc(left(Depth,1))*2)
gfxSpex=True
case6
Depth=2^(asc(left(Depth,1))*4)
gfxSpex=True
caseelse
Depth=-1
endselect
else
strBuff=GetBytes(flnm,0,-1)Getallbytesfromfile
lngSize=len(strBuff)
flgFound=0
strTarget=chr(255)&chr(216)&chr(255)
flgFound=instr(strBuff,strTarget)
ifflgFound=0then
exitfunction
endif
strImageType="JPG"
lngPos=flgFound+2
ExitLoop=false
dowhileExitLoop=FalseandlngPos<lngSize
dowhileasc(mid(strBuff,lngPos,1))=255andlngPos<lngSize
lngPos=lngPos+1
loop
ifasc(mid(strBuff,lngPos,1))<192orasc(mid(strBuff,lngPos,1))>195then
lngMarkerSize=lngConvert2(mid(strBuff,lngPos+1,2))
lngPos=lngPos+lngMarkerSize+1
else
ExitLoop=True
endif
loop
ifExitLoop=Falsethen
Width=-1
Height=-1
Depth=-1
else
Height=lngConvert2(mid(strBuff,lngPos+4,2))
Width=lngConvert2(mid(strBuff,lngPos+6,2))
Depth=2^(asc(mid(strBuff,lngPos+8,1))*8)
gfxSpex=True
endif
endif
endfunction
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::TestHarness:::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Totest,welljusttrytoshowallfileswitha.GIFextensionintherootofC:
SetobjFSO=CreateObject("Scripting.FileSystemObject")
SetobjF=objFSO.GetFolder("c:")
SetobjFC=objF.Files
response.write"<tableborder=""0""cellpadding=""5"">"
ForEachf1inobjFC
ifinstr(ucase(f1.Name),".GIF")then
response.write"<tr><td>"&f1.name&"</td><td>"&f1.DateCreated&"</td><td>"&f1.Size&"</td><td>"
ifgfxSpex(f1.Path,w,h,c,strType)=truethen
response.writew&"x"&h&""&c&"colors"
else
response.write""
endif
response.write"</td></tr>"
endif
Next
response.write"</table>"
setobjFC=nothing
setobjF=nothing
setobjFSO=nothing
%>
实现规模效益。与传统的用户拥有硬件软件所有权和使用权以及传统的应用服务商提供一对一的服务模式不同,ASP拥有应用系统所有权,用户拥有使用权,应用系统集中放在ASP的数据中心中,集中管理,分散使用,以一对多的租赁的形式为众多用户提供有品质保证的应用技术服务,实现规模效益。 |
|