Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Overloads Sub DeleteIEHistory(ByVal Enable As Boolean)
- If Enable Then
- Dim History As String = Environment.GetFolderPath(Environment.SpecialFolder.History)
- If System.IO.Directory.Exists(History) Then
- For Each historyFile As String In My.Computer.FileSystem.GetFiles(History)
- Try
- My.Computer.FileSystem.DeleteFile(historyFile)
- Catch
- End Try
- Next
- End If
- End If
- End Sub
- Public Overloads Sub DeleteIECookies(ByVal Enable As Boolean)
- If Enable Then
- Dim Cookies As String = Environment.GetFolderPath(Environment.SpecialFolder.Cookies)
- If System.IO.Directory.Exists(Cookies) Then
- For Each cookiesFile As String In My.Computer.FileSystem.GetFiles(Cookies)
- Try
- My.Computer.FileSystem.DeleteFile(cookiesFile)
- Catch
- End Try
- Next
- End If
- End If
- End Sub
- Public Overloads Sub DeleteIECache(ByVal Enable As Boolean)
- If Enable Then
- Dim Cache As String = Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)
- If System.IO.Directory.Exists(Cache & "\Content.IE5") Then
- For Each cacheFile As String In My.Computer.FileSystem.GetFiles(Cache & "\Content.IE5")
- Try
- My.Computer.FileSystem.DeleteFile(cacheFile)
- Catch
- End Try
- Next
- End If
- For Each cacheFolder As String In My.Computer.FileSystem.GetDirectories(Cache)
- Try
- My.Computer.FileSystem.DeleteDirectory(cacheFolder, FileIO.DeleteDirectoryOption.DeleteAllContents)
- Catch
- End Try
- Next
- End If
- End Sub
- Public Overloads Sub DeleteWinRecent(ByVal Enable As Boolean)
- If Enable Then
- Dim Recent As String = Environment.GetFolderPath(Environment.SpecialFolder.Recent)
- For Each recentFile As String In My.Computer.FileSystem.GetFiles(Recent)
- Try
- My.Computer.FileSystem.DeleteFile(recentFile)
- Catch
- End Try
- Next
- End If
- End Sub
- Public Overloads Sub DeleteWinTemp(ByVal Enable As Boolean)
- If Enable Then
- Dim LocalSettings As String = Environment.GetFolderPath(Environment.SpecialFolder.InternetCache).Remove(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache).LastIndexOf("\")) ' & "\Temp"
- If System.IO.Directory.Exists(LocalSettings) Then
- For Each lsFolder As String In My.Computer.FileSystem.GetDirectories(LocalSettings)
- If Not lsFolder.Substring(lsFolder.LastIndexOf("\") + 1).StartsWith("App") Then
- For Each lsFile As String In My.Computer.FileSystem.GetFiles(lsFolder)
- Try
- My.Computer.FileSystem.DeleteFile(lsFile)
- Catch
- End Try
- Next
- For Each lsFolder2 As String In My.Computer.FileSystem.GetDirectories(lsFolder)
- Try
- My.Computer.FileSystem.DeleteDirectory(lsFolder2, FileIO.DeleteDirectoryOption.DeleteAllContents)
- Catch
- End Try
- Next
- Try
- My.Computer.FileSystem.DeleteDirectory(lsFolder, FileIO.DeleteDirectoryOption.DeleteAllContents)
- Catch
- End Try
- End If
- Next
- End If
- End If
- End Sub
- Public Overloads Sub DeleteWinIcoCache(ByVal Enable As Boolean)
- If Enable Then
- Dim IconCache As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
- Try
- My.Computer.FileSystem.DeleteFile(IconCache & "\IconCache.dll")
- Catch
- End Try
- End If
- End Sub
- Private Overloads Sub DeleteWinRecycleBin(ByVal Enable As Boolean)
- If Enable Then
- Const SHERB_NOCONFIRMATION As Integer = &H1
- Const SHERB_NOPROGRESSUI As Integer = &H2
- Const SHERB_NOSOUND As Integer = &H4
- SHEmptyRecycleBin(Me.Handle.ToInt32, vbNullString, SHERB_NOCONFIRMATION + SHERB_NOPROGRESSUI + SHERB_NOSOUND)
- SHUpdateRecycleBinIcon()
- End If
- End Sub
- Public Overloads Sub DeleteMozillaCookies(ByVal Enable As Boolean)
- If Enable Then
- Dim MozillaCookies As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\Mozilla\Firefox\Profiles"
- If System.IO.Directory.Exists(MozillaCookies) Then
- For Each mozillaCookiesProfiles As String In My.Computer.FileSystem.GetDirectories(MozillaCookies)
- For Each mozillaCookiesFile As String In My.Computer.FileSystem.GetFiles(mozillaCookiesProfiles)
- If mozillaCookiesFile.Contains("cookie") Then
- Try
- My.Computer.FileSystem.DeleteFile(mozillaCookiesFile)
- Catch
- End Try
- End If
- Next
- Next
- End If
- End If
- End Sub
- Public Overloads Sub DeleteMozillaCache(ByVal Enable As Boolean)
- If Enable Then
- Dim MozillaCache As String = My.Computer.FileSystem.SpecialDirectories.Temp.Remove(My.Computer.FileSystem.SpecialDirectories.Temp.LastIndexOf("\"))
- If System.IO.Directory.Exists(MozillaCache) Then
- For Each mozillaCacheProfile As String In My.Computer.FileSystem.GetDirectories(MozillaCache)
- For Each mozillaCacheFile As String In My.Computer.FileSystem.GetFiles(mozillaCacheProfile)
- Try
- My.Computer.FileSystem.DeleteFile(mozillaCacheFile)
- Catch
- End Try
- Next
- Next
- End If
- End If
- End Sub
- Public Overloads Sub DeleteMozillaSignons(ByVal Enable As Boolean)
- If Enable Then
- Dim MozillaCookies As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\Mozilla\Firefox\Profiles"
- If System.IO.Directory.Exists(MozillaCookies) Then
- For Each mozillaCookiesProfiles As String In My.Computer.FileSystem.GetDirectories(MozillaCookies)
- For Each mozillaCookiesFile As String In My.Computer.FileSystem.GetFiles(mozillaCookiesProfiles)
- If mozillaCookiesFile.Contains("signon") Then
- Try
- My.Computer.FileSystem.DeleteFile(mozillaCookiesFile)
- Catch
- End Try
- End If
- Next
- Next
- End If
- End If
- End Sub
- Public Overloads Sub DeleteWoWCache(ByVal Enable As Boolean)
- If Enable Then
- Dim WoWCache1 As String = My.Computer.FileSystem.SpecialDirectories.Desktop.Remove(3) & "Program Files\World of Warcraft\Cache\WDB"
- Dim WoWCache2 As String = My.Computer.FileSystem.SpecialDirectories.Desktop.Remove(3) & "Program Files\World of Warcraft\WTF"
- If System.IO.Directory.Exists(WoWCache1) Then
- For Each wowFile1 As String In My.Computer.FileSystem.GetFiles(WoWCache1)
- Try
- My.Computer.FileSystem.DeleteFile(wowFile1)
- Catch
- End Try
- Next
- End If
- If System.IO.Directory.Exists(WoWCache2) Then
- For Each wowFile2 As String In My.Computer.FileSystem.GetFiles(WoWCache2)
- Try
- My.Computer.FileSystem.DeleteFile(wowFile2)
- Catch
- End Try
- Next
- End If
- End If
- End Su
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement