马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
国内有些大的CRM厂商的ASP就写得不错.无论是概念还是它里面用JAVASCRIPT的能力.并不是说现在的程序员用了ASP.NET来写程序就可以说自己高档了fso|反复删除文件
<%
|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>ASPWizardCopyright?1999-2001>>>>>>>
|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>[GenericFileDeletion]>>>>>>>>>>>>>>>>
|Author:JoaquimJos?PratesFerreira
|DateCreated:13/01/2001
|LastUpdate:28/06/2001
|Dependencies:
|Description:Thisfunctionwilldeleteunwantedfilesfromtheserver...
|V1.1:Addedanewparameter[intShowLabel]0-Donotshowlabel/1-Showlabel
|V1.0:Thisfunctiononlyacceptsoneparameteratthemoment,thepathwiththefile,
|belowthereareexamplesofhowtocallthefunction.
|e.g.
|CallGeneric_FileDeletion(FilepathREQUIRED)
|CallGeneric_FileDeletion("myfile.txt")
|CallGeneric_FileDeletion("win95/myfile.txt")
|
|PleaseremembertospecifyaPath,otherwiseanErrorwilloccur...
FunctionGeneric_FileDeletion(byvalstrpath,byvalintShowLabel)
ERRORCHECKING!!!!...
IFstrpath=""orisnull(strpath)then
Response.Write("Sorrybutapathisrequiredwhencallingthisfunction")
Response.End
EndIF
ERRORCHECKING!!!!...
IFintShowLabel=""orisnull(intShowLabel)then
Response.Write("Sorrybuttheparamter<b>intShowLabel</b>ismissing.PARAMETERISREQUIRED")
Response.End
EndIF
Filename=Server.MapPath(strpath)
Setfs=CreateObject("Scripting.FileSystemObject")
Iffs.FileExists(filename)Then
fs.DeleteFile(filename)
ifintShowLabel=1then
response.write"File"&"<b>("&strpath&")</b>"&"hasBeenDeletedwithSuccess.<BR>"
endif
Else
response.write"Nopathwasfound,orfiledoesnotexisttodelete...<BR>"
EndIf
EndFunction
%>
copy文件
<%
|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>ASPWizard.co.ukCopyright?1999-2001>>>>>>>>>>>>>>>>>
|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>[Generic_FileCopy.asp]>>>>>>>>>>>>>>>>
|Author:JoaquimJos?PratesFerreira
|LastAuthor:JoaquimJos?PratesFerreira
|DateCreated:26/04/2001
|LastUpdate:26/04/2001
|Dependencies:
|Description:ThisfunctionwillcopyFilesFrom[A]to[B]
|V1.0:ThisfunctionwillcopyafilefromoneFoldertoanother.
|
|Parameters:
|strFileSource-WespecifythepathtothefiletoCopy
|strFileDestination-Wesepcifythepathtothenewfile
|strOverWrite-Wesayifwewanttooverwrightafile
|
|E.G:
|CallGeneric_FileCopy("D:XkudosNewsX_1997.mdb","D:XkudosXkudosXkudosDBNewsX_1997.mdb",True)
FunctionGeneric_FileCopy(ByValstrFileSource,ByValstrFileDestination,ByValstrOverWrite)
--------------------------------[ERRORCHECKING]--------------------------------
ERRORCHECKING!!!!...
IFstrFileSource=""orisnull(strFileSource)Then
Response.Write("SorrybutaFileSourcepathisrequiredwhencallingthisfunction")
Response.End
EndIF
ERRORCHECKING!!!!...
IFstrFileDestination=""orisnull(strFileDestination)Then
Response.Write("SorrybutaFileDestinationpathisrequiredwhencallingthisfunction")
Response.End
EndIF
ERRORCHECKING!!!!...[True-False]
IFstrOverWrite=""orisnull(strOverWrite)Then
Response.Write("SorrybutaFileDestinationpathisrequiredwhencallingthisfunction")
Response.End
EndIF
--------------------------------[/ERRORCHECKING]--</p>缺点:安全性不是太差了,还行,只要你充分利用系统自带的工具;唯一缺点就是执行效率慢,如何进行网站优化以后,效果会比较好。 |