示例#1
0
        private bool checkpassword()
        {
            XmlTextReader read;

            if (pathkey == null)
            {
                read = new XmlTextReader(folderBrowserDialog1.SelectedPath + "\\p.xml");
            }
            else
            {
                read = new XmlTextReader(pathkey + "\\p.xml");
            }
            if (read.ReadState == ReadState.Error)
            {
                return(true);
            }
            else
            {
                try
                {
                    while (read.Read())
                    {
                        if (read.NodeType == XmlNodeType.Text)
                        {
                            unlock c = new unlock();
                            c.pass = read.Value;
                            if (c.ShowDialog() == DialogResult.OK)
                            {
                                read.Close();
                                return(true);
                            }
                        }
                    }
                }
                catch { return(true); }
            }
            read.Close();
            return(true);
        }
示例#2
0
        private void button2_Click(object sender, EventArgs e)
        {
            unlock dlg22 = new unlock();

            dlg22.ShowDialog();
        }