当前位置: 网学 > 编程文档 > ASP > 正文

FSO操作文件系统

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/17
iFormStart = iFormStart+iStart+2
''Exit at end of file
Loop Until (iFormStart+2) = iFormEnd
RequestBinDate=""
Set tStream = Nothing
End Sub

End Class

''Get File Info
Class FileInfo
Dim FormName,FileName,FilePath,FileSize,FileType,FileStart,FileExt

Private Sub Class_Initialize
FileName = ""
FilePath = ""
FileSize = 0
FileStart= 0
FormName = ""
FileType = ""
FileExt = ""
End Sub

''Save File Method
Public Function SaveToFile(FullPath)
Dim oFileStream,ErrorChar,i
On Error Resume Next
Set oFileStream=CreateObject("Adodb.Stream")
oFileStream.Type=1
oFileStream.Mode=3
oFileStream.Open
oUpFileStream.position=FileStart
oUpFileStream.copyto oFileStream,FileSize
oFileStream.SaveToFile FullPath,2
oFileStream.Close
Set oFileStream=Nothing
End Function

''Get File Content
Public Function GetDate
oUpFileStream.Position =FileStart
GetDate=oUpFileStream.Read(FileSize)
End Function
End Class
%>

核心函数
复制代码 代码如下:
Dim theInstalledObjects(17)
theInstalledObjects(0) = "MSWC.AdRotator"
theInstalledObjects(1) = "MSWC.BrowserType"
theInstalledObjects(2) = "MSWC.NextLink"
theInstalledObjects(3) = "MSWC.Tools"
theInstalledObjects(4) = "MSWC.Status"
theInstalledObjects(5) = "MSWC.Counters"
theInstalledObjects(6) = "IISSample.ContentRotator"
theInstalledObjects(7) = "IISSample.PageCounter"
theInstalledObjects(8) = "MSWC.PermissionChecker"
theInstalledObjects(9) = "Scripting.FileSystemObject"
theInstalledObjects(10) = "adodb.connection"
theInstalledObjects(11) = "SoftArtisans.FileUp"
theInstalledObjects(12) = "SoftArtisans.FileManager"
theInstalledObjects(13) = "JMail.SMTPMail"
theInstalledObjects(14) = "CDONTS.NewMail"
theInstalledObjects(15) = "Persits.MailSender"
theInstalledObjects(16) = "LyfUpload.UploadFile"
theInstalledObjects(17) = "Persits.Upload.1"
Dim fso
If IsObjInstalled(theInstalledObjects(9)) Then
Set fso =Server.CreateObject("Scripting.FileSystemObject")
End If
Function IsObjInstalled(strClassString)
On Error Resume Next
IsObjInstalled = False
Err = 0
Dim xTestObj
Set xTestObj = Server.CreateObject(strClassString)
If 0 = Err Then IsObjInstalled = True
Set xTestObj = Nothing
Err = 0
End Function
''检查组件版本
Public Function getver(Classstr)
On Error Resume Next
Dim xTestObj
Set xTestObj = Server.CreateObject(Classstr)
If Err Then
getver=""
else
getver=xTestObj.version
end if
Set xTestObj = Nothing
End Function
''效验名称
Function IsvalidFileName(File_Name)
IsvalidFileName = False
Dim re,reStr
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern="[^_\.a-zA-Z\d]"
reStr=re.Replace(File_Name,"")
If File_Name = reStr Then IsvalidFileName=True
Set re=Nothing
End Function
''文件写入
Function writeto(xmlflo

网学推荐

免费论文

原创论文

浏览:
设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
湘ICP备09003080号