DCoder Sauvgarder un fichier texte

Fermé
LolixDudu Messages postés 43 Date d'inscription mercredi 20 juin 2018 Statut Membre Dernière intervention 13 avril 2019 - 11 avril 2019 à 13:29
LolixDudu Messages postés 43 Date d'inscription mercredi 20 juin 2018 Statut Membre Dernière intervention 13 avril 2019 - 12 avril 2019 à 13:42
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
A voir également:

1 réponse

Whismeril Messages postés 19029 Date d'inscription mardi 11 mars 2003 Statut Contributeur Dernière intervention 26 avril 2024 931
11 avril 2019 à 17:31
Bonjour
Je ne connais pas cette application, mais au départ C# est un langage windows, alors peut-être faut-il des \ dans ton chemin.
0
LolixDudu Messages postés 43 Date d'inscription mercredi 20 juin 2018 Statut Membre Dernière intervention 13 avril 2019
11 avril 2019 à 17:54
Je vais regarder merci
0
LolixDudu Messages postés 43 Date d'inscription mercredi 20 juin 2018 Statut Membre Dernière intervention 13 avril 2019
11 avril 2019 à 18:06
Ha bah maintenant, j'ai plus les droits ???????? j'ai cette erreur :

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
0
Whismeril Messages postés 19029 Date d'inscription mardi 11 mars 2003 Statut Contributeur Dernière intervention 26 avril 2024 931
11 avril 2019 à 19:16
C'est pas le même fichier
0
LolixDudu Messages postés 43 Date d'inscription mercredi 20 juin 2018 Statut Membre Dernière intervention 13 avril 2019
12 avril 2019 à 13:42
En fait si c'est parce que le fichier que j'essaye d'enregistrer s'appelle pass.csv.
La, je fais juste File.WriteAllLines("pass.csv",monArray[])
0