佳木斯湛栽影视文化发展公司

主頁 > 知識庫 > 對文件的操作--建立移動刪除文件夾

對文件的操作--建立移動刪除文件夾

熱門標(biāo)簽:服務(wù)器配置 Linux服務(wù)器 團(tuán)購網(wǎng)站 科大訊飛語音識別系統(tǒng) 電子圍欄 Mysql連接數(shù)設(shè)置 阿里云 銀行業(yè)務(wù)
下面兩個文件:
!--#include virtual="/intels/chunfeng/graphicdetect.asp"-->
html>
head>
TITLE>圖像尺寸/TITLE>
/head>
body bgcolor="#FFFFFF">
%
graphic="images/intels.gif"
HW = ReadImg(graphic)
Response.Write graphic " Dimensions: " HW(0) "x" HW(1)
"br>"
response.write "img src=""/" graphic """"
response.write height=""" HW(0) """
response.write width=""" HW(0) "">"
%>
/body>
/html>

------------------------
graphicdetect.asp
%
Dim HW

Function AscAt(s, n)
AscAt = Asc(Mid(s, n, 1))
End Function

Function HexAt(s, n)
HexAt = Hex(AscAt(s, n))
End Function

Function isJPG(fichero)
If inStr(uCase(fichero), ".JPG") > 0 Then
isJPG = true
Else
isJPG = false
End If
End Function

Function isPNG(fichero)
If inStr(uCase(fichero), ".PNG") > 0 Then
isPNG = true
Else
isPNG = false
End If
End Function

Function isGIF(fichero)
If inStr(uCase(fichero), ".GIF") > 0 Then
isGIF = true
Else
isGIF = false
End If
End Function

Function isBMP(fichero)
If inStr(uCase(fichero), ".BMP") > 0 Then
isBMP = true
Else
isBMP = false
End If
End Function

Function isWMF(fichero)
If inStr(uCase(fichero), ".WMF") > 0 Then
isWMF = true
Else
isWMF = false
End If
End Function

Function isWebImg(f)
If isGIF(f) Or isJPG(f) Or isPNG(f) Or isBMP(f) Or isWMF(f)
Then
isWebImg = true
Else
isWebImg = true
End If
End Function

Function ReadImg(fichero)
If isGIF(fichero) Then
ReadImg = ReadGIF(fichero)
Else
If isJPG(fichero) Then
ReadImg = ReadJPG(fichero)
Else
If isPNG(fichero) Then
ReadImg = ReadPNG(fichero)
Else
If isBMP(fichero) Then
ReadImg = ReadPNG(fichero)
Else
If isWMF(fichero) Then
ReadImg = ReadWMF(fichero)
Else
ReadImg = Array(0,0)
End If
End If
End If
End If
End If
End Function

Function ReadJPG(fichero)
Dim fso, ts, s, HW, nbytes
HW = Array("","")
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = 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
End Function

Function ReadPNG(fichero)
Dim fso, ts, s, HW, nbytes
HW = Array("","")
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = 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
End Function

Function ReadGIF(fichero)
Dim fso, ts, s, HW, nbytes
HW = Array("","")
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = 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
End Function


Function ReadWMF(fichero)
Dim fso, ts, s, HW, nbytes
HW = Array("","")
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = 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
End Function

Function ReadBMP(fichero)
Dim fso, ts, s, HW, nbytes
HW = Array("","")
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = 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
End Function

Function isDigit(c)
If inStr("0123456789", c) > 0 Then
isDigit = true
Else
isDigit = false
End If
End Function

Function isHex(c)
If inStr("0123456789ABCDEFabcdef", c) > 0 Then
isHex = true
Else
ishex = false
End If
End Function

Function HexToDec(cadhex)
Dim n, i, ch, decimal
decimal = 0
n = Len(cadhex)
For i=1 To n
ch = Mid(cadhex, i, 1)
If isHex(ch) Then
decimal = decimal * 16
If isDigit(c) Then
decimal = decimal + ch
Else
decimal = decimal + Asc(uCase(ch)) - Asc("A")
End If
Else
HexToDec = -1
End If
Next
HexToDec = decimal
End Function
%>

標(biāo)簽:江蘇 大理 蚌埠 萍鄉(xiāng) 棗莊 衡水 廣元 衢州

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《對文件的操作--建立移動刪除文件夾》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266
    韶山市| 阳新县| 玉环县| 攀枝花市| 达日县| 元阳县| 乐都县| 云梦县| 漠河县| 板桥市| 陈巴尔虎旗| 都兰县| 化德县| 南江县| 平利县| 邹城市| 北流市| 广宗县| 江华| 克拉玛依市| 灌云县| 泗洪县| 南陵县| 青冈县| 高安市| 青川县| 彭阳县| 三台县| 滨州市| 寿宁县| 包头市| 罗甸县| 醴陵市| 宝坻区| 垦利县| 都安| 延津县| 桃园县| 阿克苏市| 灌云县| 胶州市|