473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

How can I communicate with the parallel port in C#?

C#
How can I communicate with the parallel port in C#?
Nov 22 '05 #1
2 13549

..NET 1.X does not support serial communications. You need to call unmanaged
api (e.g. CreateFile("LPT1",GENERIC_READ | GENERIC_WRITE,0, 0,OPEN_EXISTING,0,
0); ...)
Aleksey Nudelman,
http://csharpcomputing.com

"C#" wrote:
How can I communicate with the parallel port in C#?

Nov 22 '05 #2
.... And once you have the Handle, you can pass into one of the constructors
of the FileStream object and then do the usual stream I/O:

FileStream lpt = new
FileStream(hFS,System.IO.FileMode.Append,FileAcces s.Write);
String Temp="test";
Byte[] Buff = new Byte[1024];
Buff = System.Text.Encoding.Unicode.GetBytes(Temp);
lpt.Write(Buff,0,Buff.Length);
lpt.Close();

Sujit D'Mello

"csharpcomputing.com" wrote:

.NET 1.X does not support serial communications. You need to call unmanaged
api (e.g. CreateFile("LPT1",GENERIC_READ | GENERIC_WRITE,0, 0,OPEN_EXISTING,0,
0); ...)
Aleksey Nudelman,
http://csharpcomputing.com

"C#" wrote:
How can I communicate with the parallel port in C#?

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Todd Gardner | last post by:
--------------------------------------------------------------- I would appreciate any ideas how to write to the parallel port (Mem 0x378) when runnning WinXP or Mandrake 9.2. In C and LabVIEW I...
2
by: C# | last post by:
How can I communicate with the parallel port in C#?
6
by: Novice Experl | last post by:
I'd like to write a simple application that interfaces with the parallel port, and changes the data on it according to keyboard input. I hope I can get it to run under windows xp and / or windows...
1
by: c_attitude | last post by:
Is it possible to catch a signal at the parallel port without using file descriptor? I am using the ioperm, inb and outb functions to communicate vi parallel port. In this case how do i catch a...
1
by: Eric | last post by:
I want to write to parallel port to drive a device. In the code, I use run time library function _outp() to write to D0 as following: _outp(0x378, 0x01); I got an exception: "privileged...
12
by: david.brown.0 | last post by:
I'm trying to make a Java program access a parallel port. Java's comm API does not provide me with the control I need. I need to be able to write to the data and control pins and read the status...
2
by: nevermind | last post by:
Guys, i want to do project in which i will be able to control parallel port pins with a web interface.Does anyonehave any ideas to start with. Thanks
1
by: rjd | last post by:
i am tring to communicate with parallel port in vb. i wnat a source code for it. please reply urjuntly
4
by: Soren | last post by:
Hi, I want to control some motors using the parallel port.. however, my laptop does not have any parallel ports (very few do). What I do have is a USB->Parallel converter... I thought about...
1
by: ssndk123 | last post by:
Hi, Using the UserPort program that changes permissions in XP so that I am able to write directly to the parallel port using assembler.. I'm trying to send out square wave pulses for x number...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.