écriture de fichier unauthorizedaccessexception
Bonjour j'ai l'exception suivante quand je veux écrire dans un fichier
unauthorizedaccessexception quand je compile avec visual studio 2010. Comment puis je modifier les droits d'admin ?
Code:
1 2 3 4 5 6 7 8 9 10 11
|
StreamWriter outfile = new StreamWriter(@"C:\tmp.csv");
outfile.WriteLine("ID \t lot \t label \t Code \t Cote \t etat \n\n\n");
foreach (Carrier item in carrier)
{
outfile.WriteLine(""+item.id+"\t"+item.lot+"\t" +item.label+"\t=\"" + item.code + "\"\t" + item.cote + "\t " + item.state.name );
}
outfile.Close(); |
Merci d'avance.
:D