示例#1
0
文件: FormMain.cs 项目: imatary/work
        /// <summary>
        ///
        /// </summary>
        private void LoadModels()
        {
            List <string> lists = new List <string>();

            if (Ultils.GetValueRegistryKey("Models") != null)
            {
                string[] models = Ultils.GetValueRegistryKey("Models").Split(';');
                foreach (var item in models)
                {
                    lists.Add(item);
                }
            }
            else
            {
                string[] models =
                {
                    "Rm2-8419",
                    "Rm2-8420"
                };

                foreach (var item in models)
                {
                    lists.Add(item);
                    Ultils.WriteRegistryArray("Models", item);
                }
            }

            cboModels.DataSource = lists.ToList();
        }
示例#2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            string name = txtModelName.Text.ToUpper();

            if (!string.IsNullOrEmpty(name))
            {
                Ultils.WriteRegistryArray("Models", name);
                MessageBox.Show("Insert Success!");
                this.Close();
            }
            else
            {
                MessageBox.Show("Vui lòng nhập vào tên!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }