private void wizardPage2_NextButtonClick(object sender, CancelEventArgs e) { try { if (Path != string.Empty) { if (CheckAssembly(Path)) { FileInfo flinfo = new FileInfo(Path); FileName = flinfo.Name; File.Copy(Path, Environment.CurrentDirectory + "\\" + FileName, true); VpnManagerDal.InsertNewVpnType(FileName); VpnManagerDAL.DTO.VpnTypeDTO VpnType = VpnManagerDal.GetVpnTypes().Where(x => x.Name.Equals(FileName)).FirstOrDefault(); IDConection = VpnType.Id; } else { e.Cancel = true; MessageBox.Show("File Non Valido!"); } } else { e.Cancel = true; MessageBox.Show("Nessun File Selezionato!"); } } catch (Exception ex) { e.Cancel = true; MessageBox.Show(ex.Message); } }