Sending a textfile to the printer

Hi,

I need to print a few lines of text, and am loking for an easy way to do this.  So I thought it would be easiest if I simply wrote wht I need to a textfile, then sent the file to the printer.

Can anyone explain an easy way to do this?


Thanks,
Bob
ba272Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sumixCommented:
Indeed there are lots of articles that shows you how to print a file using PrintDocument class, DrawString method of Graphics class or API functions ..
  See MSDN help for PrintDocument class, or
    http://www.codeproject.com/csharp/multipadprintdocument.asp 
    http://www.c-sharpcorner.com/Code/2002/Oct/PrintDirect.asp

  But if you only want to send a file to the printer you can run a OS 'copy' command:

System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo("copy " + filename + " prn:"));
      Instead of PRN: you can also use a port name where a printer is conected (LPT1:)



0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SystemExpertCommented:
Hi,

This is for raw printing for dotmatrix
hope it will work for you

http://www.knowdotnet.com/articles/cprintreportstringdemocs.html

Thanks
0
ba272Author Commented:
actually, it's a thermal strip printer.  I don't think I'd know where to buy a dot matrix even if I wanted one!

I'm sure there is value in your link though.  So thanks,

Bob
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.