Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
how to move checkeditems file in listbox to a folder?
hi. im actually making a desktop cleaner that can move the files and icons to a folder inside the listview box.
i can make the listview box filled with files contains at the desktop
and i can make a new folder which suppose to be move the files on that folder
i have 3 problems:
1. is how to get last access time of the FILE and put it column2 of the listview
2. i want to view that are unused icon and document last week, 2weeks, 1month and 2months by selecting at the combobox
3. how to move checkeditems file in listbox to a folder?
i've been researching for 2 days and not posting a topic and now im frustrated
help me.. thanks in advance.
Imports System.Runtime.InteropServices 'For APIs
Imports System.IO 'Import System.IO For File Operations
Imports Microsoft.Win32 'The Registry stuff
'TO view files inside the listbox
Public Class Form1
Private Filenames() As String
Private Sub LoadFilenames()
Dim Desktop As String = My.Computer.FileSystem.SpecialDirectories.Desktop.ToString()
Dim FilePath As String
Dim NumFiles As Integer
Dim TruncName As String
For Each FilePath In Directory.GetFiles(Desktop)
TruncName = FilePath.Substring(FilePath.LastIndexOf("") + 1) 'Remove Path From Name
ReDim Preserve ScreenNames(NumFiles)
FileNames(NumFiles) = FilePath
NumFiles = NumFiles + 1 'Increment File Count
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TO CREATE A FOLDER ON DESKTOP
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Desktop As String = My.Computer.FileSystem.SpecialDirectories.Desktop
If Not My.Computer.FileSystem.DirectoryExists(Desktop & "Unused Desktop Icon and Documents") Then
My.Computer.FileSystem.CreateDirectory(Desktop & "Unused Desktop Icon and Documents")
For i As Integer = 0 To .CheckedItems.Count - 1
' If di.Exists Then
' Indicate that it already exists.
' MsgBox("That path exists already.")
' Try to create the directory.
' End If
'TextBox1.Text = di.FullName
0 · ·