подскажите кто знает, что не правильно, пытаюсь произвести простейшую запись в порт но Visual Studio .Net ругается.
пишу в Visual Studio .Net 2003:
вот листинг:
using System;
using System.IO;
using System.IO.Ports;
namespace ConsoleApplication2
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class SerialPort
{
System.IO.Ports.SerialPort port = new System.IO.Ports.Serialport();
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
port.PortName = "COM1";
port.WriteTimeout = 500;
port.ReadTimeout = 500;
port.BaudRate = 9600;
port.Parity = Parity.None;
port.DataBits = 8;
port.StopBits = StopBits.One;
port.Handshake = Handshake.RequestToSend;
port.DtrEnable = true;
port.RtsEnable = true;
port.NewLine = System.Environment.NewLine;
port.Open();
port.WriteLine("AT#CLS=8");
port.Close();
//
// TODO: Add code to start application here
//
}
}
}
сообщения об ошибке:
(3): The type or namespace name 'Ports' does not exist in the class or namespace 'System.IO' (are you missing an assembly reference?)
(12): The type or namespace name 'Ports' does not exist in the class or namespace 'System.IO' (are you missing an assembly reference?)
[Ответ]