aspÎļþ²Ù×÷´óÈ«
<%
Class Cls_FSO
Public objFSO
Private Sub Class_Initialize()
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
End Sub
Private Sub class_terminate()
Set objFSO = Nothing
End Sub
'=======Îļþ²Ù×÷========
'È¡Îļþ´óС
Public Function GetFileSize(FileName)
Dim f
If ReportFileStatus(FileName) = 1 Then
Set f = objFSO.Getfile(FileName)
GetFileSize = f.Size
Else
GetFileSize = -1
End if
End Function
'Îļþɾ³ý
Public Function deleteAFile(FileSpec)
If ReportFileStatus(FileSpec) = 1 Then
objFSO.deleteFile(FileSpec)
deleteAFile = 1
Else
deleteAFile = -1
End if
End Function
'ÏÔʾÎļþÁбí
Public Function ShowFileList(FolderSpec)
Dim f, f1, fc, s
If ReportFolderStatus(FolderSpec) = 1 Then
Set f = objFSO.GetFolder(FolderSpec)
Set fc = f.Files
For Each f1 in fc
s = s & f1.name
s = s & "|"
Next
ShowFileList = s
Else
ShowFileList = -1
End if
End Function
'Îļþ¸´ÖÆ
Public Function CopyAFile(SourceFile, DestinationFile)
Dim MyFile
If ReportFileStatus(SourceFile) = 1 Then
Set MyFile = objFSO.GetFile(SourceFile)
MyFile.Copy (DestinationFile)
CopyAFile = 1
Else
CopyAFile = -1
End if
End Function
'ÎļþÒƶ¯
Public Function MoveAFile(SourceFile,DestinationFile)
If ReportFileStatus(SourceFile) = 1 And ReportFileStatus(DestinationFileORPath) = -1 Then
objFSO.MoveFile SourceFile,DestinationFileORPath
MoveAFile = 1
Else
MoveAFile = -1
End if
End Function
'ÎļþÊÇ·ñ´æÔÚ£¿
Public Function ReportFileStatus(FileName)
Dim msg
msg = -1
If (objFSO.FileExists(FileName)) Then
msg = 1
Else
msg = -1
End If
ReportFileStatus = msg
End Function
'Îļþ´´½¨ÈÕÆÚ
Public Function ShowDatecreated(FileSpec)
Dim f
If ReportFileStatus(FileSpec) = 1 Then
Set f = objFSO.GetFile(FileSpec)
ShowDatecreated = f.Datecreated
Else
ShowDatecreated = -1
End if
End Function
'ÎļþÊôÐÔ
Public Function GetAttributes(FileName)
Dim f
Dim str
Ïà¹ØÎĵµ£º
ASPÀà
£½£½£½£½£½£½£½£½£½
ʹÓÃVBSµÄASPÒ²Äܶ¨ÒåÀàµÄ£¡±¾ÎĽ«½éÉܶ¨Ò塢ʹÓÃÀàµÄ»ù±¾·½·¨¡£
ÔÚASP£¨ÌØָʹÓÃVBSµÄASP£¬ÏÂͬ£©ÀʹÓÃClassÓï¾äÀ´ÉùÃ÷Ò»¸öÀà¡£Óï·¨ÈçÏ£º
Class ˈ̞
End Class
ÀàµÄ¶¨Òå¡¢±äÁ¿¡¢ÊôÐԺͷ½·¨µÈ¶¼°üº¬ÔÚClass...End Class¿éÖС£
ÏÂÃæ¾Í¿ÉÒÔ¶¨ÒåÀàµÄÊôÐԺͷ½·¨ÁË¡£Õýʽ½²ÊôÐÔ¡¢·½·¨µ ......
<!--#include file=common.asp-->
<%
'**********************************************
' code by aspµ¼³öexcelͨÓÃ
' ÐÞ¸ÄÒýÓà by ×ÓÑÔ(jastudio)
' qq:23638564 email:kpggdf@163.com
' web:www.gdsspt.com
'**********************************************
dim xibua
dim mysql
xibua = request ......
ODBCÊý¾ÝÔ´¿É·ÖΪ“ϵͳÐÍ”ºÍ“ÎļþÐÍ”£¬ËûÃǵÄÇø±ðÔÚÓړϵͳÐÍ”ÊÇÁ¬½ÓÊý¾Ý¿âµÄÐÅÏ¢½¨Á¢Ôړϵͳע²á±í”À“ÎļþÐÍ”ÔòÊÇÒÔdsnÎļþÐÎʽ´æ´¢ÔÚODBCÔ´µÄĿ¼ÏÂÃæ
Ò»¡¢½¨Á¢ODBCÊý¾ÝÔ´µÄ·½·¨£º
¿ØÖÆÃæ°å - ¹ÜÀí¹¤¾ß - Êý¾ÝÔ´£¨ODBC£©
´ò¿ªODBCÊý¾ÝÔ´¹ÜÀíÆ÷£¬È»ºóÒ ......
aspÁ¬½ÓaccessºÍmssqlµÄÍòÄÜ´úÂ룺
'½â¾öÁËACCESSÊý¾Ý¿â·¾¶µÄÎÊÌ⣡
'²ÉÓÃDBType=0»òDBType=1À´Çø·ÖAC¿â»¹ÊÇMSSQL¿â
'¾ßÌå²ÉÓÃAC¿âʱӦעÒâµÄÊÂÏÇë¿´³ÌÐò˵Ã÷
-----------------------------------------------
Dim DBType,Conn,StrConn
DBType=0 '0ΪAccessÊý¾Ý¿â£¬1ΪMSSQLÊý¾Ý¿â
If(DBType=0) Then
......