System.Configuration

Résolu
francesdereve Messages postés 75 Date d'inscription mardi 6 décembre 2005 Statut Membre Dernière intervention 6 août 2007 - 26 janv. 2006 à 22:44
francesdereve Messages postés 75 Date d'inscription mardi 6 décembre 2005 Statut Membre Dernière intervention 6 août 2007 - 27 janv. 2006 à 22:33
J'ai modifie mon fichier app.config ainsi que le fichier .exe.config par le biais de fichier tout a marché,mais quand la prochaine fois je


redemarre mon programme ,j'ai cette erreur.


System.Configuration.AppSettingsReader configurationAppSettings = new


System.Configuration.AppSettingsReader();


An unhandled exception of type


'System.Configuration.ConfigurationException' occurred in system.dll


Additional information: This is an unexpected token. The expected token


is 'NAME'. par le biais de fichier tout a marché,mais quand la


prochaine fois je redemarre mon programme ,j'ai cette erreur.


System.Configuration.AppSettingsReader configurationAppSettings = new


System.Configuration.AppSettingsReader();
Voici mon fichier app.config voici mon fichier exe.config,apres l'execution toutes les valeurs des textbox sont ecrits dans le fichierFD
le voici
<?xml version="1.0" encoding="utf-8"?>
<configuration>

<!--User application and configured property settings go here.-->
<!--Example: -->




























</configuration>

2 réponses

sebmafate Messages postés 4936 Date d'inscription lundi 17 février 2003 Statut Membre Dernière intervention 14 février 2014 37
27 janv. 2006 à 06:04
il manque les espaces avant les value=

Sébastien FERRAND
[MVP Visual C#]
3
francesdereve Messages postés 75 Date d'inscription mardi 6 décembre 2005 Statut Membre Dernière intervention 6 août 2007
27 janv. 2006 à 22:33
Merci,ca a marché mais je veux avoir le chemin complet de mon fichier en lui donnant le nom.Dans mon texte box le chemin est affiché,mais je n'arrive pas à ecrire dans le fichier mais quand je lui donne le chemin complet dans le streamwriter,j'arrive à ecrire mais quand je passe à StreamWriter la variable qui contient le chemin du fichier ,l'ecriture n'est pas fait


string cheminlumdemo=System.IO.Path.GetFullPath("france.exe.config");



string cheminapp=System.IO.Path.GetFullPath("app.config");


cheminlumdemo=cheminlumdemo.Replace("\","\\\");


cheminapp=cheminapp.Replace("\","\\\");


File.Delete(cheminapp);


File.Copy(cheminfrance,cheminapp);

FD
0
Rejoignez-nous