spicyadmin
Member
- Joined
- Dec 23, 2021
- Messages
- 15
- Programming Experience
- Beginner
Though (sorry to bother again) I am having one other problem now with a different part. I want to read and write to a file in the "MyDocuments" folder. I used the same method as the first problem I was having but the file doesnt show up in the "MyDocuments" folder, the file shows up in the executables directory.
C#:
private void btn_deletePrevious_Click(object sender, EventArgs e)
{
string docPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
using (StreamWriter writer = new StreamWriter(Path.Combine(docPath, "camList.ini"))) { }
}
private void button1_Click(object sender, EventArgs e)
{
string cDirs = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
string line;
StreamReader file = new System.IO.StreamReader(Path.Combine(cDirs, "camList.ini"));
while ((line = file.ReadLine()) != null)
{
lbx_camList.Items.Add(line);
}
file.Close();
}