void SetPathUser(bool Alert) { if (txtRestore.Text == "") { if (Alert) { MessageBox.Show("请先选择要还原的文件"); } return; } string _Path = Path.GetDirectoryName(txtRestore.Text); if (File.Exists(Path.Combine(_Path, "ACL.xml"))) { _Path = Path.Combine(_Path, "ACL.xml"); } else if (_Path.EndsWith("History", true, null) || _Path.EndsWith("MetaBack", true, null)) { string p = _Path.Remove(_Path.LastIndexOf('\\')) + "\\ACL.xml"; if (File.Exists(p)) { _Path = p; } else { _Path = string.Empty; } } else { _Path = string.Empty; } if (_Path != string.Empty) { DataSet ds = new DataSet(); ds.ReadXml(_Path); DataView dv = ds.Tables[0].DefaultView; dv.RowFilter = " ACL like '%,IIS_WPG,%' or ACL like '%,NETWORK SERVICE,%' "; if (dv.Count > 0) { frmPathACL frm = new frmPathACL(); frm.dt = ds.Tables[0]; frm.StartPosition = FormStartPosition.CenterParent; frm.ShowDialog(); } } else { if (Alert) { MessageBox.Show("权限文件不存在"); } } }