萌萌妈妈 发表于 2015-2-16 00:25:13

ASP网页编程之用FSO取得图片文件的信息(巨细,宽,高...

Access是一种桌面数据库,只适合数据量少的应用,在处理少量数据和单机访问的数据库时是很好的,效率也很高。但是它的同时访问客户端不能多于4个。access数据库有一定的极限,如果数据达到100M左右,很容易造成服务器iis假死,或者消耗掉服务器的内存导致服务器崩溃。fso   <%
'':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
''::: BMP, GIF, JPG and PNG :::
'':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
''::: :::
''::: This function gets a specified number of bytes from any :::
''::: file, starting at the offset (base 1) :::
''::: :::
''::: Passed: :::
''::: flnm => Filespec of file to read :::
''::: offset => Offset at which to start reading :::
''::: bytes => How many bytes to read :::
''::: :::
'':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
function GetBytes(flnm, offset, bytes)
Dim objFSO
Dim objFTemp
Dim objTextStream
Dim lngSize
on error resume next
Set objFSO = CreateObject("Scripting.FileSystemObject")

'' First, we get the filesize
Set objFTemp = objFSO.GetFile(flnm)
lngSize = objFTemp.Size
set objFTemp = nothing
fsoForReading = 1
Set objTextStream = objFSO.OpenTextFile(flnm, fsoForReading)
if offset > 0 then
strBuff = objTextStream.Read(offset - 1)
end if
if bytes = -1 then '' Get All!
GetBytes = objTextStream.Read(lngSize) ''ReadAll
else
GetBytes = objTextStream.Read(bytes)
end if
objTextStream.Close
set objTextStream = nothing
set objFSO = nothing
end function
'':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
''::: :::
''::: Functions to convert two bytes to a numeric value (long) :::
''::: (both little-endian and big-endian) :::
''::: :::
'':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
function lngConvert(strTemp)
lngConvert = clng(asc(left(strTemp, 1)) + ((asc(right(strTemp, 1)) * 256)))
end function
function lngConvert2(strTemp)
lngConvert2 = clng(asc(right(strTemp, 1)) + ((asc(left(strTemp, 1)) * 256)))
end function

'':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
''::: :::
''::: This function does most of the real work. It will attempt :::
''::: to read any file, regardless of the extension, and will :::
''::: identify if it is a graphical image. :::
''::: :::
''::: Passed: :::
''::: flnm => Filespec of file to read :::
''::: width => width of image :::
''::: height => height of image :::
''::: depth => color depth (in number of colors) :::
''::: strImageType=> type of image (e.g. GIF, BMP, etc.) :::
''::: :::
'':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
function gfxSpex(flnm, width, height, depth, strImageType)
dim strPNG
dim strGIF
dim strBMP
dim strType
strType = ""
strImageType = "(unknown)"
gfxSpex = False
strPNG = chr(137) & chr(80) & chr(78)
strGIF = "GIF"
strBMP = chr(66) & chr(77)
strType = GetBytes(flnm, 0, 3)
if strType = strGIF then '' is GIF
strImageType = "GIF"
Width = lngConvert(GetBytes(flnm, 7, 2))
Height = lngConvert(GetBytes(flnm, 9, 2))
Depth = 2 ^ ((asc(GetBytes(flnm, 11, 1)) and 7) + 1)
gfxSpex = True
elseif left(strType, 2) = strBMP then '' is BMP
strImageType = "BMP"
Width = lngConvert(GetBytes(flnm, 19, 2))
Height = lngConvert(GetBytes(flnm, 23, 2))
Depth = 2 ^ (asc(GetBytes(flnm, 29, 1)))
gfxSpex = True
elseif strType = strPNG then '' Is PNG
strImageType = "PNG"
Width = lngConvert2(GetBytes(flnm, 19, 2))
Height = lngConvert2(GetBytes(flnm, 23, 2))
Depth = getBytes(flnm, 25, 2)
select case asc(right(Depth,1))
case 0
Depth = 2 ^ (asc(left(Depth, 1)))
gfxSpex = True
case 2
Depth = 2 ^ (asc(left(Depth, 1)) * 3)
gfxSpex = True
case 3
Depth = 2 ^ (asc(left(Depth, 1))) ''8
gfxSpex = True
case 4
Depth = 2 ^ (asc(left(Depth, 1)) * 2)
gfxSpex = True
case 6
Depth = 2 ^ (asc(left(Depth, 1)) * 4)
gfxSpex = True
case else
Depth = -1
end select
</p>我想详细了解ASP整站代码与PSP整站代码有什么优缺点,那个更好,更安全,更用容易维护,和管理。。。

柔情似水 发表于 2015-2-16 01:14:11

运用ASP可将VBscript、javascript等脚本语言嵌入到HTML中,便可快速完成网站的应用程序,无需编译,可在服务器端直接执行。容易编写,使用普通的文本编辑器编写,如记事本就可以完成。由脚本在服务器上而不是客户端运行,ASP所使用的脚本语言都在服务端上运行。

变相怪杰 发表于 2015-2-28 20:48:29

运用ASP可将VBscript、javascript等脚本语言嵌入到HTML中,便可快速完成网站的应用程序,无需编译,可在服务器端直接执行。容易编写,使用普通的文本编辑器编写,如记事本就可以完成。由脚本在服务器上而不是客户端运行,ASP所使用的脚本语言都在服务端上运行。

简单生活 发表于 2015-3-6 21:22:21

下载一个源代码,然后再下载一个VBScript帮助,在源代码中遇到不认识的函数或是其他什么程序,都可以查帮助进行解决,这样学习效率很高。

灵魂腐蚀 发表于 2015-3-11 04:53:31

它可通过内置的组件实现更强大的功能,如使用A-DO可以轻松地访问数据库。

若相依 发表于 2015-3-13 21:56:00

我就感觉到ASP和一些常用的数据库编程以及软件工程方面的思想是非常重要的。我现在也在尝试自己做网页,这其中就用到了ASP,我想它的作用是可想而知的。

只想知道 发表于 2015-3-20 19:46:38

如何更好的使自己的东西看上去很不错等等。其实这些都不是问题的实质,我们可以在实践中不断提升自己,不断充实自己。

因胸联盟 发表于 2015-3-24 20:49:59

运用ASP可将VBscript、javascript等脚本语言嵌入到HTML中,便可快速完成网站的应用程序,无需编译,可在服务器端直接执行。容易编写,使用普通的文本编辑器编写,如记事本就可以完成。由脚本在服务器上而不是客户端运行,ASP所使用的脚本语言都在服务端上运行。

admin 发表于 2015-3-25 08:16:31

我可以结合自己的经验大致给你说一说,希望对你有所帮助,少走些弯路。

谁可相欹 发表于 2015-4-3 12:24:05

ASP也是这几种脚本语言中最简单易学的开发语言。但ASP也是这几种语言中唯一的一个不能很好支持跨平台的语言。  因为ASP脚本语言非常简单,因此其代码也简单易懂,结合HTML代码,可快速地完成网站的应用程序。

仓酷云 发表于 2015-4-12 15:33:13

Server:这个表示的服务器,操作服务器的一些东西使用这个,如Server.Mappath转换服务器路径,Server.CreateObject实例化一个组件

第二个灵魂 发表于 2015-5-10 00:18:37

没有坚实的理论做基础,那么我们连踏入社会第一步的资本都没有,特别对于计算机专业的学生学好专业知识是置关重要的。在这里我侧重讲一下如何学习ASP,从平时的学习过程中。

莫相离 发表于 2015-6-5 16:08:56

那么,ASP.Net有哪些改进呢?

分手快乐 发表于 2015-6-9 03:04:29

先学习用frontpage熟悉html编辑然后学习asp和vbscript建议买书进行系统学习

小妖女 发表于 2015-6-13 00:38:14

我想问如何掌握学习节奏(先学什么再学什么)最好详细点?

飘飘悠悠 发表于 2015-7-6 00:41:29

兴趣爱好,那么你无须学编程,申请一个域名和空间,在网上下载一些免费开源的CMS系统,你不用改代码,只须熟悉它们的后台操作,像office一样简单方便,很快就能建一个站点,很多站长都是这样做的

蒙在股里 发表于 2015-7-10 06:26:12

最近在学asp,不要问我为什么不直接学.net,因为公司网站是asp做的所以有这个需要,卖了本书asp入门到精通,对里面的六大内置对象老是记不住,还有很多属性和方法看的头晕。

老尸 发表于 2015-7-10 20:43:37

我想问如何掌握学习节奏(先学什么再学什么)最好详细点?

金色的骷髅 发表于 2015-10-3 21:10:08

Response:从字面上讲是“响应”,因此这个是服务端向客户端发送东西的,例如Response.Write

深爱那片海 发表于 2015-10-5 00:47:00

还有如何才能在最短的时间内学完?我每天可以有效学习2小时,双休日4小时。
页: [1] 2
查看完整版本: ASP网页编程之用FSO取得图片文件的信息(巨细,宽,高...