DDR爱好者之家 Design By 杰米
<%
On Error Resume Next
Dim r
Set r = New Rar
r.Add Server.MapPath("a.gIf")
r.Add Server.MapPath("a.txt")
r.Add Server.MapPath("test")
r.Add Server.MapPath("file.asp")
r.packname = Server.MapPath("xxx.dat")
r.Pack
r.rootpath = Server.MapPath("xxx")
r.packname = Server.MapPath("xxx.dat")
r.UnPack
Response.Write(Err.Description)
Set r = Nothing
%>
<script Language="Vbscript" Runat="server">
'-----------------------------------------------------
' 描述: Asp打包类
' 作者: 小灰(quxiaohui_0@163.com)
' 链接: http://asp2004.net http://blog.csdn.net/iuhxq http://bbs.asp2004.net
' 版本: 1.0 Beta
' 版权: 本作品可免费使用,但是请勿移除版权信息
'-----------------------------------------------------
Class Rar
Dim files,packname,s,s1,s2,rootpath,fso,f,buf
Private Sub Class_Initialize
Randomize
Dim ranNum
ranNum = Int(90000 * Rnd) + 10000
packname = Year(Now)&Month(Now)&Day(Now)&Hour(Now)&Minute(Now)&Second(Now)&ranNum&".asp2004"
rootpath = Server.MapPath("./")
Set files = server.CreateObject("Scripting.Dictionary")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set s = server.CreateObject("ADODB.Stream"):s.Open:s.Type = 1
Set s1 = server.CreateObject("ADODB.Stream"):s1.Open:s1.Type = 1
Set s2 = server.CreateObject("ADODB.Stream"):s2.Open:s2.Type = 2
End Sub
Private Sub Class_Terminate
s.Close:Set s = Nothing
s1.Close:Set s1 = Nothing
s2.Close:Set s2 = Nothing
Set fso = Nothing
End Sub
Public Sub Add(obj)
If fso.FileExists(obj) Then
Set f = fso.GetFile(obj)
files.Add obj,f.Size
ElseIf fso.FolderExists(obj) Then
files.Add obj,-1
Set f = fso.GetFolder(obj)
Set fc = f.Files
For Each f1 in fc
Add(LCase(f1.Path))
Next
End If
End Sub
Public Sub Pack
Dim str
a = files.Keys
b = files.Items
for i=0 to files.count-1
If b(i)>=0 Then
s.LoadFromFile(a(i))
buf = s.Read
If Not IsNull(buf) Then s1.Write(buf)
End If
str = str & b(i)&">"&Replace(a(i),rootpath,"")&vbCrLf
next
str = CStr(Right("000000000"&len(str),10)) & str
buf = TextToStream(str)
s.Position = 0
s.Write buf
s1.Position = 0
s.Write s1.Read
s.SetEOS
s.SaveToFile(packname)
End Sub
Public Sub UnPack
If Not fso.FolderExists(rootpath) Then
fso.CreateFolder(rootpath)
End If
Dim size
'转换文件大小
s.LoadFromFile(packname)
size = CInt(StreamToText(s.Read(10)))
str = StreamToText(s.Read(size))
arr = Split(str,vbCrLf)
for i=0 to Ubound(arr)-1
arrFile = Split(arr(i),">")
If arrFile(0) < 0 Then
If Not fso.FolderExists(rootpath&arrFile(1)) Then
fso.CreateFolder(rootpath&arrFile(1))
End If
ElseIf arrFile(0) >= 0 Then
If fso.FileExists(rootpath&arrFile(1)) Then
fso.DeleteFile(rootpath&arrFile(1))
End If
s1.Position = 0
buf = s.Read(arrFile(0))
If Not IsNull(buf) Then s1.Write(buf)
s1.SetEOS
s1.SaveToFile(rootpath&arrFile(1))
End If
Next
End Sub
Public Function StreamToText(stream)
If IsNull(stream) Then
StreamToText = ""
Else
Set sm = server.CreateObject("ADODB.Stream"):sm.Open:sm.Type = 1
sm.Write(stream)
sm.Position = 0
sm.Type = 2
sm.charset = "gb2312"
sm.Position = 0
StreamToText = sm.ReadText()
sm.Close:Set sm = Nothing
End If
End Function
Public Function TextToStream(text)
If text="" Then
TextToStream = "" '这里该如何写?空流?
Else
Set sm = server.CreateObject("ADODB.Stream"):sm.Open:sm.Type = 2:sm.charset = "gb2312"
sm.WriteText(text)
sm.Position = 0
sm.Type = 1
sm.Position = 0
TextToStream = sm.Read
sm.Close:Set sm = Nothing
End If
End Function
End Class
</script>
On Error Resume Next
Dim r
Set r = New Rar
r.Add Server.MapPath("a.gIf")
r.Add Server.MapPath("a.txt")
r.Add Server.MapPath("test")
r.Add Server.MapPath("file.asp")
r.packname = Server.MapPath("xxx.dat")
r.Pack
r.rootpath = Server.MapPath("xxx")
r.packname = Server.MapPath("xxx.dat")
r.UnPack
Response.Write(Err.Description)
Set r = Nothing
%>
<script Language="Vbscript" Runat="server">
'-----------------------------------------------------
' 描述: Asp打包类
' 作者: 小灰(quxiaohui_0@163.com)
' 链接: http://asp2004.net http://blog.csdn.net/iuhxq http://bbs.asp2004.net
' 版本: 1.0 Beta
' 版权: 本作品可免费使用,但是请勿移除版权信息
'-----------------------------------------------------
Class Rar
Dim files,packname,s,s1,s2,rootpath,fso,f,buf
Private Sub Class_Initialize
Randomize
Dim ranNum
ranNum = Int(90000 * Rnd) + 10000
packname = Year(Now)&Month(Now)&Day(Now)&Hour(Now)&Minute(Now)&Second(Now)&ranNum&".asp2004"
rootpath = Server.MapPath("./")
Set files = server.CreateObject("Scripting.Dictionary")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set s = server.CreateObject("ADODB.Stream"):s.Open:s.Type = 1
Set s1 = server.CreateObject("ADODB.Stream"):s1.Open:s1.Type = 1
Set s2 = server.CreateObject("ADODB.Stream"):s2.Open:s2.Type = 2
End Sub
Private Sub Class_Terminate
s.Close:Set s = Nothing
s1.Close:Set s1 = Nothing
s2.Close:Set s2 = Nothing
Set fso = Nothing
End Sub
Public Sub Add(obj)
If fso.FileExists(obj) Then
Set f = fso.GetFile(obj)
files.Add obj,f.Size
ElseIf fso.FolderExists(obj) Then
files.Add obj,-1
Set f = fso.GetFolder(obj)
Set fc = f.Files
For Each f1 in fc
Add(LCase(f1.Path))
Next
End If
End Sub
Public Sub Pack
Dim str
a = files.Keys
b = files.Items
for i=0 to files.count-1
If b(i)>=0 Then
s.LoadFromFile(a(i))
buf = s.Read
If Not IsNull(buf) Then s1.Write(buf)
End If
str = str & b(i)&">"&Replace(a(i),rootpath,"")&vbCrLf
next
str = CStr(Right("000000000"&len(str),10)) & str
buf = TextToStream(str)
s.Position = 0
s.Write buf
s1.Position = 0
s.Write s1.Read
s.SetEOS
s.SaveToFile(packname)
End Sub
Public Sub UnPack
If Not fso.FolderExists(rootpath) Then
fso.CreateFolder(rootpath)
End If
Dim size
'转换文件大小
s.LoadFromFile(packname)
size = CInt(StreamToText(s.Read(10)))
str = StreamToText(s.Read(size))
arr = Split(str,vbCrLf)
for i=0 to Ubound(arr)-1
arrFile = Split(arr(i),">")
If arrFile(0) < 0 Then
If Not fso.FolderExists(rootpath&arrFile(1)) Then
fso.CreateFolder(rootpath&arrFile(1))
End If
ElseIf arrFile(0) >= 0 Then
If fso.FileExists(rootpath&arrFile(1)) Then
fso.DeleteFile(rootpath&arrFile(1))
End If
s1.Position = 0
buf = s.Read(arrFile(0))
If Not IsNull(buf) Then s1.Write(buf)
s1.SetEOS
s1.SaveToFile(rootpath&arrFile(1))
End If
Next
End Sub
Public Function StreamToText(stream)
If IsNull(stream) Then
StreamToText = ""
Else
Set sm = server.CreateObject("ADODB.Stream"):sm.Open:sm.Type = 1
sm.Write(stream)
sm.Position = 0
sm.Type = 2
sm.charset = "gb2312"
sm.Position = 0
StreamToText = sm.ReadText()
sm.Close:Set sm = Nothing
End If
End Function
Public Function TextToStream(text)
If text="" Then
TextToStream = "" '这里该如何写?空流?
Else
Set sm = server.CreateObject("ADODB.Stream"):sm.Open:sm.Type = 2:sm.charset = "gb2312"
sm.WriteText(text)
sm.Position = 0
sm.Type = 1
sm.Position = 0
TextToStream = sm.Read
sm.Close:Set sm = Nothing
End If
End Function
End Class
</script>
DDR爱好者之家 Design By 杰米
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
DDR爱好者之家 Design By 杰米
暂无评论...
P70系列延期,华为新旗舰将在下月发布
3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。
而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?
根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。
更新日志
2024年11月28日
2024年11月28日
- 凤飞飞《我们的主题曲》飞跃制作[正版原抓WAV+CUE]
- 刘嘉亮《亮情歌2》[WAV+CUE][1G]
- 红馆40·谭咏麟《歌者恋歌浓情30年演唱会》3CD[低速原抓WAV+CUE][1.8G]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[320K/MP3][193.25MB]
- 【轻音乐】曼托凡尼乐团《精选辑》2CD.1998[FLAC+CUE整轨]
- 邝美云《心中有爱》1989年香港DMIJP版1MTO东芝首版[WAV+CUE]
- 群星《情叹-发烧女声DSD》天籁女声发烧碟[WAV+CUE]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[FLAC/分轨][748.03MB]
- 理想混蛋《Origin Sessions》[320K/MP3][37.47MB]
- 公馆青少年《我其实一点都不酷》[320K/MP3][78.78MB]
- 群星《情叹-发烧男声DSD》最值得珍藏的完美男声[WAV+CUE]
- 群星《国韵飘香·贵妃醉酒HQCD黑胶王》2CD[WAV]
- 卫兰《DAUGHTER》【低速原抓WAV+CUE】
- 公馆青少年《我其实一点都不酷》[FLAC/分轨][398.22MB]
- ZWEI《迟暮的花 (Explicit)》[320K/MP3][57.16MB]