Milk
❔ "cant open file due to it being used by another process"
The process cannot access the file 'C:\Users\user\source\repos\Clickity\Clickity\bin\Debug\net6.0-windows\score.txt' because it is being used by another process
The process cannot access the file 'C:\Users\user\source\repos\Clickity\Clickity\bin\Debug\net6.0-windows\score.txt' because it is being used by another process
private void button4_Click(object sender, EventArgs e)
{
System.IO.StreamWriter SaveFile = new System.IO.StreamWriter(sPath);
foreach (var item in listBox1.Items)
{
SaveFile.WriteLine(item.ToString());
}
SaveFile.Close();
}
private void button5_Click(object sender, EventArgs e)
{
System.IO.StreamWriter SaveFile = new System.IO.StreamWriter(sPath);
string[] lines = File.ReadAllLines(sPath);
foreach (string line in lines)
Console.WriteLine(line);
SaveFile.Close();
}
private void button4_Click(object sender, EventArgs e)
{
System.IO.StreamWriter SaveFile = new System.IO.StreamWriter(sPath);
foreach (var item in listBox1.Items)
{
SaveFile.WriteLine(item.ToString());
}
SaveFile.Close();
}
private void button5_Click(object sender, EventArgs e)
{
System.IO.StreamWriter SaveFile = new System.IO.StreamWriter(sPath);
string[] lines = File.ReadAllLines(sPath);
foreach (string line in lines)
Console.WriteLine(line);
SaveFile.Close();
}
9 replies