muktesh

muktesh

  • NA
  • 11
  • 0

Error in using Ini plz help

Oct 19 2008 1:50 PM
i have a form in which there is textBox1 and textBox2. when anybody enter anything in textbox the value will be saved in .ini file on C drive.And when the form re-opens that value retrieves from that .ini file and shops in both textbox.
Following is the code there is only one error in this code.
The error is under using Ini; and it says that(The type namespace name 'Ini' could not be found are you missing a using directive or an assembly reference?).
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using Ini;
namespace IniTest
{
   
    public class Form1 : System.Windows.Forms.Form
    {

        public Form1()
        {
                        InitializeComponent();
        }
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            IniFile ini = new IniFile("C:\\test.ini");
            ini.IniWriteValue("Info","Name",name.Text);
            ini.IniWriteValue("Info","LastName",lname.Text);
            ini.IniWriteValue("Info", "Sex", textBox1.Text);
        }
        private void Form1_Load(object sender, System.EventArgs e)
        {
            IniFile ini = new IniFile("C:\\test.ini");
            name.Text= ini.IniReadValue("Info","Name");
            lname.Text = ini.IniReadValue("Info","LastName");
            textBox1.Text = ini.IniReadValue("Info", "Sex");
        }
    }
}



Answers (1)