過去ログ

                                Page       5
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   通常モードに戻る  ┃  INDEX  ┃  ≪前へ  │  次へ≫   
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ▼ゴミ箱の内容を日付順に並べる(vbs)  YAma 02/8/1(木) 9:39

 ───────────────────────────────────────
 ■題名 : ゴミ箱の内容を日付順に並べる(vbs)
 ■名前 : YAma
 ■日付 : 02/8/1(木) 9:39
 -------------------------------------------------------------------------
   'ゴミ箱の内容を日付順に並べる
'          By YAma
  Dim  BugWeb
  Dim  ScriptPath
  Dim  objFSO
  Set BugWeb = CreateObject("BugWeb.BugBrowserAPI")
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  ScriptPath = objFSO.GetParentFolderName(objFSO.GetAbsolutePathName("BugWeb.exe")) & "\Script"
  Set objFSO = Nothing

  If CreateTrashHTML(BugWeb,ScriptPath) = True Then
    BugWeb.NavigateNew(ScriptPath & "\TrashURL.html")
  End If
  Set BugWeb = Nothing
  'スクリプト終了
  WScript.Quit

'HTML作成関数
Function CreateTrashHTML(objBugWeb,szPath)
Dim  URL()
Dim  Title()
Dim  MakeDate()
Dim  MakeTime()
Dim i
Dim objTrash
Dim objFSO
Dim objHTML
Dim BeforeDate

  If objBugWeb.TrashCount = 0 Then
    CreateTrashHTML = False
    Exit Function
  End If

  ReDim URL(objBugWeb.TrashCount-1)
  ReDim Title(objBugWeb.TrashCount-1)
  ReDim MakeDate(objBugWeb.TrashCount-1)
  ReDim MakeTime(objBugWeb.TrashCount-1)

  'ゴミ箱の内容を取得
  For i = 0 To objBugWeb.TrashCount - 1
    Set objTrash = objBugWeb.CreateTrashItemObject(i)
    URL(i) = objTrash.URL
    Title(i) = objTrash.Title
    MakeDate(i) = CDate(Left(objTrash.Date,4) & "/" & Mid(objTrash.Date,5,2) & "/" & Right(objTrash.Date,2))
'    MakeTime(i) = CDate(Left(objTrash.Time,2) & ":" & Mid(objTrash.Time,3,2) & ":" & Right(objTrash.Time,2))
    Set objTrash = Nothing
  Next
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objHTML = objFSO.OpenTextFile(szPath & "\TrashURL.html", 2, 1, 0)

  '出力ファイルを作成
  'HTMLヘッダ作成
  Call objHTML.WriteLine("<HTML><HEAD><TITLE>ゴミ箱日付一覧</TITLE></HEAD>")
  Call objHTML.WriteLine("<BODY>")  Call objHTML.WriteLine("<TABLE BORDER>")
  For i=UBound(URL) to 0 Step -1
    If BeforeDate <> MakeDate(i) Then
      Call objHTML.WriteLine("</TD></TR>")
      Call objHTML.WriteLine("<TR><TD>" & Year(MakeDate(i)) & "年" & _
                        Month(MakeDate(i)) & "月" & _
                        Day(MakeDate(i)) & "日" & "</TD>")
      BeforeDate = MakeDate(i)
      Call objHTML.WriteLine("<TD>")
    End If
    Call objHTML.WriteLine("<A HREF=" & Chr(&H22) & URL(i) & Chr(&H22) & ">" & Title(i) & "</A><BR><BR>")
  Next
  Call objHTML.WriteLine("</TR></TABLE>")
  Call objHTML.WriteLine("</BODY>")
  Call objHTML.WriteLine("</HTML>")
  objHTML.Close
  Set objHTML = Nothing
  Set objFSO = Nothing
  CreateTrashHTML = True
End Function

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━    通常モードに戻る  ┃  INDEX  ┃  ≪前へ  │  次へ≫    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━                                 Page 5