exception UnauthorizedAccessException
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.