0

Hello all, having a problem with an auto save function.

System.IO.File.WriteAllLines(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), Form1.myList.ToArray());

basically it keeps telling me i dont have permissions, i even tried running my software with admin rights.

I do have a couple of questions,
1: I have not specified a text title, and System.IO.File.WriteAllLines does not let me specify a text title. Why? and how do i?

2: How do i set permissions? i have succesfully used system io with a save dialog and never had a permissions problem.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by fastfingers
0

you should specify a file name as follows:

string[] deneme ={ "ali", "veli", "deli","oldu" };
			System.IO.File.WriteAllLines(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\myfile.txt", deneme);
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.