.NET

Criptografar Connection String (App.Confing / Web.Config)

public static void ProtectSection(String sSectionName)
{
// Open the app.config file.
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
// Get the section in the file.
ConfigurationSection section = config.GetSection(sSectionName);
// If the section exists and the section is not readonly, then protect the section.
if (section != null)
{
if (!section.IsReadOnly())
{
// Protect the section.
section.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider");
section.SectionInformation.ForceSave = true;
// Save the change.
config.Save(ConfigurationSaveMode.Modified);
}
}

Mais >

Restaurar banco do MySQL em C# (2/2)

MySql

Process.Start("cmd.exe", "/c /*CAMINHO DO MYSQL.EXE*/ +
                          " -u/*usuario*/ -p/*senha*/ /*banco*/ < "+/*CAMINHO DO ARQUIVO .SQL*/);

Mais >

Fazendo backup do MySql com C# (1/2)

Agora vamos ver um método prático e sagaz de se fazer um backup em código do banco de dados.

Mais >

Pegar endereço a partir de CEP

C#

Depois de 2 semanas sem postar nada voltei =D

Mais >