How to write an app to automatically send a job to the printer?

  • Thread starter Thread starter Ric Da Force
  • Start date Start date
R

Ric Da Force

Hi there,

I currently have a USB printer that is permanently connected to one of the
machines in the office. I would like to write a simple application whereby
other users in other computers could copy a file to a directory which the
application monitors in the background. Whenever the application sees a new
file in the in directory it processes it and, if successful, writes it to
the out folder. I am not really looking for resiliency or any elaborate
means to detect that the file has actually been printed. Just something
that gets the file and dumps it in the printer using the default print
settings.

Being a system admin with a little C# knowledge I know how to modify a
prototype to fit my needs but wouldn't really know where to start with the
application. Can someone please help?

Naturally, I could just go out and buy an USB to Ethernet print server but
that wouldn't be a fun way to learn C# would it?

Regards,

Ricko
 
Ric Da Force,

Take a look at the FileSystemWatcher class in the MSDN. You can use this to
watch for changes in a directory and then program your functionality (i.e.
move to another folder, check file contents, etc...) to the events of this
class.

I hope this helps.
-----------------------
 
Start a new ConsoleApplication Project, in the main method use the
System.IO.Directory to get all the file in a directory, then use the
System.Diagnostic.Process to start a print job for each file.
 
Back
Top