private void MainForm_FormClosed(object sender, FormClosedEventArgs e) { if (nfsClient != null) { nfsClient.UnMountDevice(); nfsClient.Disconnect(); } }