Advertisement
Crecket

Untitled

Jul 22nd, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports System
  2. Imports System.IO
  3. Imports System.Collections
  4. Imports System.Environment
  5.  
  6. Public Class Form1
  7.  
  8.     Dim appData As String = GetFolderPath(SpecialFolder.UserProfile)
  9.     Dim crsfolder As String = "\.crs_cache_v4"
  10.     Dim fullpath As String = appData & crsfolder
  11.  
  12.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  13.         If Directory.Exists(fullpath) Then
  14.             TextBox1.Text = fullpath
  15.         Else
  16.             TextBox1.Text = "Cache was not found"
  17.             Button1.Visible = False
  18.         End If
  19.     End Sub
  20.  
  21.     Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  22.         Me.Close()
  23.     End Sub
  24.  
  25.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  26.         Dim response As String = MsgBox("Are you sure you wish to delete this folder?", vbYesNo, "Continue")
  27.         If response = vbYes Then
  28.             If Directory.Exists(fullpath) Then
  29.                 System.IO.Directory.Delete(fullpath, True)
  30.                 MsgBox("Cache was deleted")
  31.             Else
  32.                 MsgBox("Cache was NOT found")
  33.             End If
  34.  
  35.         Else
  36.  
  37.         End If
  38.     End Sub
  39. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement