Пример #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Hashtable properties = PropertiesUtil.Load("./cfg.txt");

            if (properties != null)
            {
                this.username.Text = (string)properties["username"];
                this.password.Text = (string)properties["password"];
            }
        }
Пример #2
0
        private Hashtable SaveProperties()
        {
            string    file       = @"./cfg.txt";
            Hashtable properties = new Hashtable
            {
                { "username", this.username.Text },
                { "password", this.password.Text }
            };

            PropertiesUtil.Save(file, properties);
            return(properties);
        }