dgorsman

Ok, heres the set-up:

I have a console application running on another computer, monitoring a specific network "input" folder. When certain types of files are sent to that folder, the console app fires up a licenced application to convert the file to another type. The converted file is placed in an "output" folder and the original file is erased. All fine and well.

What I'm trying to do:

Now I'm working on another windows-based program in C# that will automate sending the files to the converter, wait for the conversion, then move the converted file back to the local hard drive and point a custom viewer control object to the converted file. This program, when finished, will act as a simple viewer for 3D models.

The problem:

The conversion process can take several minutes, and I would like the viewer program to continue to function during that time, while keeping an eye out for the converted file. I'm relatively new to C# and windows programming, but have loads of experience in more linear applications. Using a simple do/while loop would be the brute force approach but there should be a more elegant solution that allows the user to continue to work with the viewer application in the meaintime. With that in mind, please keep it simple, and I don't mind being pointed to specific items in the help file as places to get started.



Re: Visual C# General Sending/picking up file for conversion

OmegaMan

Put the work to moniter the application in a seperate thread. I provide an example, with the consumption of a web service, where the data retrieval is on another thread. Read the article and place your operation in, instead of the web service call. See Web Service Consumption and Winform Data Display and C# Threading Worker Class which shows you how to write a class to handle threading.