Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            MouseLeftButtonDown += (o, args) =>
            {
                var hwnd = new WindowInteropHelper(this).Handle;
                ReleaseCapture();
                SendMessage(hwnd, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
            };

            fileOP createDir = new fileOP();
            createDir.createFileRootDir("CarpNote");

            List<string> bookNameList = createDir.traBook();

            for (int i = 0; i < bookNameList.Count;i++ )
            {
                TreeViewItem tvi = new TreeViewItem();
                tvi.Header=bookNameList[i].ToString();
                tv_book_book.Items.Add(tvi);
            }

            ConfigXML userInfo = new ConfigXML();
            UserName = userInfo.getUserID();
            UserPW = userInfo.getUserPW();

        }
Ejemplo n.º 2
0
        //保存账户
        private void but_Close_Click(object sender, RoutedEventArgs e)
        {
            ConfigXML xmlOP = new ConfigXML();
            if (tb_UserID.Text.ToString() == null || tb_UserPW.Password.ToString() == null)
            {
                MessageBox.Show("请输入账号或密码!");
                tb_UserID.Text = "";
                tb_UserPW.Password = "";

                return;
            }

            if (tb_UserID.Text.ToString().Length != 8 || tb_UserPW.Password.ToString().Length != 8)
            {
                MessageBox.Show("密码和账户必须为8位!");
                return;
            }

            xmlOP.setUserID(tb_UserID.Text.ToString());
            xmlOP.setUserPW(tb_UserPW.Password.ToString()); 
        }