Click here to Skip to main content
15,886,812 members

Comments by Retro617 (Top 6 by date)

Retro617 24-Jul-14 13:32pm View    
OK, figured out that it has to be the starting form. I tested it by switching the run application in Program.cs
Retro617 24-Jul-14 13:26pm View    
It is a built in object/function call.
Retro617 24-Jul-14 13:16pm View    
No, it is a separate form. it is a form where you click on the run button and the form I want to show shows. but every time I click the minimize button the application stops. Very frustrating to say the least :)
Retro617 24-Jul-14 12:13pm View    
I have a form that I open before the main form, I close that form on a button click and showdialog() for the form I am working in. I can only think that there is something wrong with the wait it is being handled there.

webServer ws = new webServer();
this.Visible = false;
ws.ShowDialog();
this.Close();
Retro617 11-Jul-14 12:02pm View    
Thank you George. You are right my question was terribly vague. So this is what I want to do, I am creating a back up program. I found the only way to get the file names from all the sub directories was to create a function call to my ShowAllFolders(). Inside of that I created a queue so that I do not have to wait forever for the files to be searched. A basic in and out if you will.

At this point I want to show the file names being queued in my status strip label(which I have created). Unfortunately, the status strip is not available to write to, I will put the threee functions I want to work together with here:


private void backgroundWorker2_DoWork(object sender, DoWorkEventArgs e)
{
// System.Threading.Thread.Sleep(60000);

foreach(string s in Directory.GetLogicalDrives())
{
ShowAllFoldersUnder(s, 0);
}

}

public static void ShowAllFoldersUnder(string path, int indent)
{
workingFolder localWorkingFolder;

Queue folderListQueue = new Queue();
int keyCounter = 0;
try
{
foreach (string folder in Directory.GetDirectories(path))
{
localWorkingFolder.completeWorkingPath = folder;
folderListQueue.Enqueue(localWorkingFolder);
Console.WriteLine("Count of Items in the Queue: " + folderListQueue.Count);
Console.WriteLine("{0}{1}", new string(' ', indent), Path.GetFullPath(folder));
localWorkingFolder = (workingFolder)folderListQueue.Dequeue();
string PathToSearch = localWorkingFolder.completeWorkingPath;
//Console.WriteLine(localWorkingFolder);
try
{ foreach(string f in Directory.GetFiles(PathToSearch,"*.*"))
{
UpdateStatus(f);
Console.WriteLine(f);
}
}
catch (System.Exception excpt)
{
Console.WriteLine(excpt.Message);
}


ShowAllFoldersUnder(folder, +2);
keyCounter++;
}
}
catch (UnauthorizedAccessException) { }
Console.WriteLine("There were " + keyCounter + " files to be searched");
}

public static void UpdateStatus(string fileSearched)
{
string updatedFile = fileSearched;
//MessageBox.Show(updatedFile);
return;


}