I am writing a small program in C # that scans a folder and opens files created after 5:30 pm after clicking a button in the program. It will also have to be looked for in subfolders.
I need several solutions to point me in the right direction, as I am not sure how to do this.
This is part of the folder viewer. The problem is when the user goes home, the PC is turned off, and the files are created in the directory after 17.30. Therefore, I need a way, when the program restarts in the morning, it detects something created after 17.30 and opens them.
private void button1_Click(object sender, EventArgs e) { folderBrowser.ShowDialog(); textBox1.Text = folderBrowser.SelectedPath; filewatcher.Path = textBox1.Text; Registry.SetValue("HKEY_CURRENT_USER\\SOFTWARE\\COMPANY\\FOLDERWATCHER", "FOLDERPATH", textBox1.Text); } private void Form1_Load(object sender, EventArgs e) { String WatchFolder = Registry.GetValue("HKEY_CURRENT_USER\\SOFTWARE\\COMPANY\\FOLDERWATCHER", "FOLDERPATH", "").ToString(); textBox1.Text = WatchFolder; filewatcher.Path = WatchFolder; } private void Form1_Resize(object sender, EventArgs e) { if (WindowState == FormWindowState.Minimized) { ShowInTaskbar = true; Hide(); } } private void fileSystemWatcher1_Changed(object sender, System.IO.FileSystemEventArgs e) { if(!e.FullPath.EndsWith("temp.temp")) { MessageBox.Show("You have a Collection Form: " + e.Name); Process.Start("explorer.exe", e.FullPath); } } private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) { Show(); } }
This is my complete code above. I would like to use the button to open or show files created after 17.30.
source share