سلام
امکانات مورد نیازتون در system.io.ports قرار داره
باید با دیوایستون دیتا رو ارسال کنید و با نرم افزارتون اطلاعات فرمان رو بگیرید و کار لازم رو انجام بدید
private void BeginAsyncRead()
{
byte[] byIn = new
byte[InputReportLength];
File.BeginRead(byIn, 0,
InputReportLength, new
AsyncCallback(ReadCompleted),
byIn);
}
protected void ReadCompleted(
IAsyncResult iResult)
{
byte[] byIn =
(byte[])iResult.AsyncState;
try
{
File.EndRead(iResult);
try
{
HandleDataReceived(byIn);
}
finally
{
BeginAsyncRead();
}
}
catch (IOException ioexc)
{
// Device has been removed!
}
}