DCoder Sauvgarder un fichier texte
LolixDudu
Messages postés
43
Date d'inscription
Statut
Membre
Dernière intervention
-
LolixDudu Messages postés 43 Date d'inscription Statut Membre Dernière intervention -
LolixDudu Messages postés 43 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
J'utilise l'application Android DCoder et j'aimerais tout simplement savoir comment enregistrer un fichier texte avec la fonction File.WriteAllLines().
Actuellement j'ai une erreur comme quoi le chemin specifié n'est pas bon. Voici le chemin spécifié "/storage/emulated/0/montexte.csv". Évidement montexte.csv n'existe pas encore mais normalement il est censée créer un fichier non ?
Merci pour vos réponses
J'utilise l'application Android DCoder et j'aimerais tout simplement savoir comment enregistrer un fichier texte avec la fonction File.WriteAllLines().
Actuellement j'ai une erreur comme quoi le chemin specifié n'est pas bon. Voici le chemin spécifié "/storage/emulated/0/montexte.csv". Évidement montexte.csv n'existe pas encore mais normalement il est censée créer un fichier non ?
Merci pour vos réponses
A voir également:
- DCoder Sauvgarder un fichier texte
- Fichier bin - Guide
- Comment réduire la taille d'un fichier - Guide
- Comment ouvrir un fichier epub ? - Guide
- Fichier rar - Guide
- Fichier .dat - Guide
Unhandled Exception:
System.UnauthorizedAccessException: Access to the path "/var/www/webapp/Dcoder/pass.csv" is denied.
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) <0x7fc86f672290 + 0x00532> in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) <0x7fc86f672240 + 0x00017> in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
at System.IO.StreamWriter.CreateFile (System.String path, System.Boolean append, System.Boolean checkHost) <0x7fc86f663460 + 0x00078> in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize, System.Boolean checkHost) <0x7fc86f663220 + 0x00088> in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
at System.IO.StreamWriter..ctor (System.String path) <0x7fc86f663170 + 0x0002a> in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
at (wrapper remoting-invoke-with-check) System.IO.StreamWriter..ctor(string)
at System.IO.File.WriteAllLines (System.String path, System.String[] contents) <0x7fc86f671770 + 0x0003c> in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
at Dcoder.Program.Main (System.String[] args) [0x000a8] in <537e4b5f6b2241eaa2871df140668f34>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.UnauthorizedAccessException: Access to the path "/var/www/webapp/Dcoder/pass.csv" is denied.
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) <0x7fc86f672290 + 0x00532> in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) <0x7fc86f672240 + 0x00017> in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
at System.IO.StreamWriter.CreateFile (System.String path, System.Boolean append, System.Boolean checkHost) <0x7fc86f663460 + 0x00078> in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize, System.Boolean checkHost) <0x7fc86f663220 + 0x00088> in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
at System.IO.StreamWriter..ctor (System.String path) <0x7fc86f663170 + 0x0002a> in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
at (wrapper remoting-invoke-with-check) System.IO.StreamWriter..ctor(string)
at System.IO.File.WriteAllLines (System.String path, System.String[] contents) <0x7fc86f671770 + 0x0003c> in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
at Dcoder.Program.Main (System.String[] args) [0x000a8] in <537e4b5f6b2241eaa2871df140668f34>:0
La, je fais juste File.WriteAllLines("pass.csv",monArray[])