Hi misters,
I have an app.config (UTF-8 format file). I create an application winforms
for changes and save configuration programatically .
When I save changes the format file changes to ANSI :( but I need format
file UTF-8, and too when I open app.config and changed it, Visual Studio
save it like UTF-8.
Any suggestions or comments, please ? I need help about it
Thanks in advance. See code below please
My code is:
string rutaConfig= tbRutaConfigSer vicioIndexado.T ext;
// Map to the application configuration file.
ExeConfiguratio nFileMap configFile= New ExeConfiguratio nFileMap();
configFile.ExeC onfigFilename = rutaConfig;
Configuration config=
ConfigurationMa nager.OpenMappe dExeConfigurati on(configFile,
ConfigurationUs erLevel.None);
string[] keys = config.AppSetti ngs.Settings.Al lKeys;
KeyValueConfigu rationCollectio n settings1= config.AppSetti ngs.Settings();
settings1("PDF_ CREADOR").Value = tbServicioIndex adoPDF_CREADOR. Text;
config.Connecti onStrings.Conne ctionStrings["SQLConnect ion"].ConnectionStri ng
= tbCadenaConexio nFirmasParaServ icioIndexado.Te xt;
//' Modifica el app.config pero pierde los comentarios del appsettings
config.Save(Con figurationSaveM ode.Modified);
ServiceModelSec tionGroup sectionGroup =
ServiceModelSec tionGroup.GetSe ctionGroup(conf ig);
ChannelEndpoint ElementCollecti on listaEndpoints =
sectionGroup.Cl ient.Endpoints;
if (listaEndpoints .Count >= 2)
{
ChannelEndpoint Element endpoint = null;
ChannelEndpoint Element endpoint2 = null;
// Endpoint Agente Servicio Base
endpoint = BuscarEndpointC lientePorNombre (listaEndpoints ,
"AgenteServicio Base");
endpoint.Addres s = new Uri(endpointAge nteServicioBase );
// Endpoint Agente Log
endpoint2 = BuscarEndpointC lientePorNombre (listaEndpoints ,
"AgenteLog" );
endpoint2.Addre ss = new Uri(endpointAge nteLog);
}
config.Save(Con figurationSaveM ode.Modified);
--
http://www.alhambra-eidos.es/web2005/index.html
www.kiquenet.com/churrosoft
http://www.setbb.com/putainformatica...opic.php?p=843
www.trabajobasura.com/solusoft