|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
asp,你就只能等着微软给你解决,它不乐意你就只好悲催。而且asp跑在windows服务器上,windows服务器跟linux比起来简直弱爆了!网上找的一段代码,把它编译成组件就能够用了,还撑持png<br>
<br>
<br>
Ihavereleasedthissourcecodeintothepublicdomain.Youmayuseit<br>
withnostringsattached.<br>
JustcallGetImageSizewithastringcontainingthefilename,and<br>
itwillreturnauserdefinedtypeImageSize(seebelow)<br>
Returnvaluesof0indicateanerrorofsomesort.Theerrorhandling<br>
inthismoduleislimited.Thereis*NO*errorhandlingonthetest<br>
form.ThisroutineislimitedtoXorYsizesof32767pixels,butthat<br>
shouldnotbeaproblem.<br>
<br>
Checkbackathttp://www.qtm.net/~davidc<br>
Imayaddsupportformorefiletypes.<br>
<br>
supportedinthisversion:<br>
JPEG<br>
GIF<br>
PNG<br>
<br>
ThisroutinedoesnotrequireanyroyaltyfeesforUnisysasit<br>
doesnothingwiththecompressedpartofGIFfiles.Itsimplyreads<br>
4bytestodetermineimagesize.<br>
<br>
OptionExplicit<br>
PublicWImgAsLong<br>
PublicHImgAsLong<br>
PublicTypeImageSize<br>
WidthAsLong<br>
HeightAsLong<br>
EndType<br>
<br>
PublicSubGetImageSize(sFileNameAsString)<br>
OnErrorResumeNextyoullwanttochangethis<br>
DimiFNAsInteger<br>
DimbTemp(3)AsByte<br>
DimlFlenAsLong<br>
DimlPosAsLong<br>
DimbHmsbAsByte<br>
DimbHlsbAsByte<br>
DimbWmsbAsByte<br>
DimbWlsbAsByte<br>
DimbBuf(7)AsByte<br>
DimbDoneAsByte<br>
DimiCountAsInteger<br>
<br>
lFlen=FileLen(sFileName)<br>
iFN=FreeFile<br>
OpensFileNameForBinaryAsiFN<br>
Get#iFN,1,bTemp()<br>
<br>
PNGfile<br>
IfbTemp(0)=&H89AndbTemp(1)=&H50AndbTemp(2)=&H4E_<br>
AndbTemp(3)=&H47Then<br>
Get#iFN,19,bWmsb<br>
Get#iFN,20,bWlsb<br>
Get#iFN,23,bHmsb<br>
Get#iFN,24,bHlsb<br>
GetImageSize.Width=CombineBytes(bWlsb,bWmsb)<br>
GetImageSize.Height=CombineBytes(bHlsb,bHmsb)<br>
WImg=CombineBytes(bWlsb,bWmsb)<br>
HImg=CombineBytes(bHlsb,bHmsb)<br>
EndIf<br>
<br>
GIFfile<br>
IfbTemp(0)=&H47AndbTemp(1)=&H49AndbTemp(2)=&H46_<br>
AndbTemp(3)=&H38Then<br>
Get#iFN,7,bWls</p>ASP最大的缺点在于网络的安全性和可靠性,企业将经营数据放在开放的平台上,最大的担忧就是如何保证这些数据不被其他人破坏。 |
|