CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2008
    Posts
    108

    Write to parallel port using CSharp?

    Writing to a parallel (printer) port in the old days of 'C' was easy.
    Code:
    outp(lpt1, lpt1_port_val);
    Does CSharp provide capability to write to and read from a parallel port?
    Or have the latest Windows OS like XP and Vista precluded one from using a parallel port? (if one could find a computer that had anything other than the USB port)

  2. #2
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Write to parallel port using CSharp?


  3. #3
    Join Date
    Apr 2006
    Posts
    220

    Re: Write to parallel port using CSharp?

    Code:
    [DllImport("inpout32.dll", EntryPoint="Out32")]
    public static extern void Output(int adress, int value);
    is the way to do it using C#.

  4. #4
    Join Date
    Feb 2008
    Posts
    108

    Re: Write to parallel port using CSharp?

    Thanks for the responses. The last 3 PCs I bought have only USB ports.
    I regret this, since parallel port interface is simpler to implement than to USB ports, but it is good to know that C-Sharp does provide a means to talk to a parallel port if it were available.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured