private void restore(int machineno = 1) { bool stuts = CheckStatus(txt_ipaddress.Text); OpenFileDialog sf = new OpenFileDialog(); sf.DefaultExt = "*.csv"; sf.FileName = "backup.csv"; if (sf.ShowDialog() != DialogResult.OK) { return; } string[] Lines = File.ReadAllLines(sf.FileName); Cursor = Cursors.WaitCursor; axCZKEM1.EnableDevice(machineno, false); if (axCZKEM1.BeginBatchUpdate(machineno, 1)) { int iPrivilege = 0; //default previlege string password = ""; bool Enabled = true; //Enabled by default int FingerIndex = 6; foreach (string usr in Lines) { string[] details = usr.Split(','); if (axCZKEM1.SSR_SetUserInfo(machineno, details[0], details[0], password, iPrivilege, Enabled)) //upload user information to the memory { axCZKEM1.SSR_SetUserTmpStr(machineno, details[0], FingerIndex, details[2]); } } } axCZKEM1.BatchUpdate(machineno); //upload all the information in the memory axCZKEM1.RefreshData(machineno); //the data in the device should be refreshed axCZKEM1.EnableDevice(machineno, true); Cursor = Cursors.Default; MessageBox.Show("Restore done!"); }