Lire fichier caché !

eheh - 5 juin 2013 à 14:05
 Utilisateur anonyme - 5 juin 2013 à 15:12
Bonjour, j'ai caché un fichier txt grâce a "IO.File.SetAttributes(Application.StartupPath & "/maj.txt", IO.FileAttributes.Hidden)" et je voudrais lire le txt en récupérant ce qu'il y a dedans avec "IO.StreamReader" mais une erreur se produit...
Je voudrais savoir si il y a une commande pour lire les fichiers cachés !
En espèrant être clair et que quelqu'un pourra m'aider !
Merci :)

2 réponses

Utilisateur anonyme
5 juin 2013 à 14:45
Bonjour,

C'est normal:
"/maj.txt" ==>> "\maj.txt"


Cordialement


CF2i - Guadeloupe
Ingénierie Informatique
0
Utilisateur anonyme
5 juin 2013 à 15:12
Et tu peux aussi l'ouvrir comme ça:

 IO.File.SetAttributes(Application.StartupPath & "\maj.txt", IO.FileAttributes.Hidden)
        MessageBox.Show(System.IO.File.ReadAllText(Application.StartupPath & "\maj.txt"))


Eh eh...


Cordialement


CF2i - Guadeloupe
Ingénierie Informatique
0
Rejoignez-nous