'It was originally written in VB to encapsulate it into DLL for Asp use, and later upgraded to vb.net
'This is part of the movie site I wrote before. The program is quite simple and there are no comments. Everyone can deal with it.
'programbysomeeyes
'Enable to declare ImportsSystem.IO namespace
PublicFunctionmyFileExists(ByValpathNameAsString)AsString'Check whether the file exists
IfFile.Exists(pathName)=FalseThen
myFileExists="<fontcolor=""Red"">File Lost</font>"
Else
myFileExists="<fontcolor=""#0066ff"">File exists</font>""
EndIf
EndFunction
PrivatesubmyCreatDirectory(ByValpathNameAsString)'Create folder
Try
IfDirectory.Exists(pathName)=FalseThen
Directory.CreateDirectory(pathName)
EndIf
CatcheAsException
myErrMsg=myErrMsg&"Create"&pathName&"An unexpected error occurred when I created the folder "
myErrMsg=myErrMsg&e.ToString
HttpContext.Current.Response.Write("The program encountered an unexpected error. Please check the log file for details!<br>")
EndTry
EndSub
PrivateSubmyDelDirectory(ByValpathNameAsString)'Delete folder
Try
IfDirectory.Exists(pathName)=TrueThen
Directory.Delete(pathName)
EndIf
CatcheAsException
MyErrMsg=myErrMsg&"Delete"&pathName&"An unexpected error occurred when myErrMsg=myErrMsg&" folder."