Please help, does not work.
SerialPort serial = new SerialPort("COM4", 9600);
Timer timer = new Timer();
public Form1()
{
InitializeComponent();
timer.Interval=5;
timer.Tick += new EventHandler(aktivuj);
}
public void aktivuj(object sender,EventArgs e)
{
string s;
Invalidate();
serial.Open();
serial.Write(textBox1.Text.ToString());
s = serial.ReadLine();
serial.Close();
label1.Text = s;
}
When I run the program occurs exception UnauthorizedAccessException.
Exception UnauthorizedAccessException
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Afzaal Ahmad ZeeshanRank #60 · 27.6K pointsPosted Apr 2, 2015, 5:23 PM EDT