Each time you call
it updates the labels with the values from your internal variables, and saves them to individual files.
But unless you somewhere read those files and update the values of
from them, or otherwise update the variables it will have no effect on your labels.
I'd suggest a change: use the settings file instead: open the Solution pane, open the project branch, then double click "Settings.settings".
In the resulting page, create two new lines named
, make them both
, and leave the scope as
. Add a
of 0 for each.
Now in your code, you can load your internal variables in the Form.Load event:
signalCountI = Properties.Settings.Default.ICount
signalCountO = Properties.Settings.Default.OCount
And save them in your Form.Closing event:
Properties.Settings.Default.ICount = signalCountI
Properties.Settings.Default.OCount = signalCountO
And the system will handle it all for you. All you need to do is update
when you want to count data in or out, or reset them to zero when you need to.