'もともとは、ASPを使用するためにDLLにカプセル化するためにVBで書かれ、後にVB.NETにアップグレードされました
「これは私が以前に書いた映画サイトの一部です。プログラムは非常に簡単で、コメントはありません。誰もがそれに対処することができます。
'Programbysomeyes
'Importssystem.io namespaceを宣言できるようにします
publicFunctionMyFileEexists(byvalpathnameasstring)Asstring'Checkファイルが存在するかどうか
iffile.exists(pathname)= falsethen
myfileexists = "<fontcolor =" "red" "> file lost </font>"
それ以外
myfileexists = "<fontcolor =" "#0066ff" ">ファイル</font>" "
endif
エンド機能
privateubmycreatdirectory(byvalpathnameasstring) 'フォルダーの作成
試す
ifdirectory.exists(pathname)= falsethen
directory.createdirectory(pathname)
endif
Catcheasexception
myerrmsg = myerrmsg& "create"&pathname& "フォルダを作成したときに予期しないエラーが発生しました」
myerrmsg = myerrmsg&e.tostring
httpcontext.current.response.write( "プログラムに予期しないエラーが発生しました。詳細についてはログファイルを確認してください!<br>")
エンドトリー
Endingub
privateubmydeldirectory(byvalpathnameasstring) '削除フォルダー
試す
ifdirectory.exists(pathname)= truethen
directory.delete(pathname)
endif
Catcheasexception
myErrmsg = myerrmsg& "delete"& "pathname&" myerrmsg = myerrmsg& "folderのときに予期しないエラーが発生しました。」