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 shows 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; (Error in this line only)
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",textBox1.Text);
ini.IniWriteValue("Info","LastName",textBox2.Text);
}
private void Form1_Load(object sender, System.EventArgs e)
{
IniFile ini = new IniFile("C:\\test.ini");
textBox1.Text= ini.IniReadValue("Info","Name");
textBox2.Text = ini.IniReadValue("Info","LastName");
}
}
}
Loading
Moses SpencerPosted Mar 26, 2015, 6:35 AM
You would need to change this:
Into this:
And change your event handlers to something like this:
AlanPosted Oct 19, 2008, 6:50 PM
It sounds to me as though you need to add a reference to your project to whatever dll includes the Ini namespace.
I'm no help in identifying it as I haven't seen it before and it's not part of the .NET framework.
In case you haven't added a reference before, just right click on the project name in Solution Explorer, select Add Reference from the drop down menu, click the appropriate tab and browse to the dll.