DirectoryInfo dir=new DirectoryInfo(path);
if (!dir.Exists)
{
Directory.CreateDirectory(path);
File.Create(path + "\\file.xml");
StreamWriter sw =new StreamWriter(path + "\\file.xml");
sw.Flush();
sw.Write("<?xml version='1.0' encoding='utf-8' ?><project></project>");
}
Fehler verwendet wird:Der Prozess kann nicht auf die Datei zugreifen 'C: file.xml', weil sie von einem anderen Prozess
The process cannot access the file 'C:\file.xml' because it is being used by another process.
warum? Wie kann Datei geschlossen werden?
Fehler: Der Typ 'System.IO.FileStream' kann nicht implizit in 'System.IO.StreamWriter' konvertiert werden. – user1263390