As far as in this block of code you might get an error:
private void timer1_Tick(object sender, EventArgs e)
uptimeTxt.Text = ts.Days + "d" + ts.Hours + "h" +
ts.Minutes + "m" + ts.Seconds + "s";
Because you try to update upimeTxt text value from a particular thread . which is not a UI thread.
So basically , you must perform uptimeTxt.Text update workflow in UI synchronized code:
someLabel.Text = newText; }