本文整理汇总了C#中IniFile.WriteInteger方法的典型用法代码示例。如果您正苦于以下问题:C# IniFile.WriteInteger方法的具体用法?C# IniFile.WriteInteger怎么用?C# IniFile.WriteInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IniFile
的用法示例。
在下文中一共展示了IniFile.WriteInteger方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: gravarDados
/*******************************************************************************************************************************************/
private void gravarDados()
{
try
{
var iniFile = new IniFile("./Config.ini");
iniFile.WriteInteger("Configuracao", "QtdeEmailBloco", Convert.ToInt32(txtQtdeLote.Value));
iniFile.WriteInteger("Configuracao", "QtdeEmailScript", Convert.ToInt32(txtQtdeEmailScript.Value));
iniFile.WriteInteger("Configuracao", "IntevaloLote", Convert.ToInt32(txtIntevaloLote.Value));
iniFile.WriteInteger("Configuracao", "IntevaloEmail", Convert.ToInt32(txtIntevaloEmail.Value));
iniFile.WriteString("Configuracao", "NomeRemetente", txtNomeRemetente.Text);
String nomeLog = "./Mailing.txt";
using (StreamWriter writer = new StreamWriter(nomeLog, false))
{
for (int i = 0; i < dgvArquivos.Rows.Count; i++)
{
writer.WriteLine(dgvArquivos.Rows[i].Cells[1].Value.ToString());
}
}
String nomeScript = "./Script.txt";
using (StreamWriter writer = new StreamWriter(nomeScript, false))
{
for (int i = 0; i < dgvScripts.Rows.Count; i++)
{
writer.WriteLine(dgvScripts.Rows[i].Cells[1].Value.ToString());
}
}
MessageBox.Show("Gravado com sucesso!", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show("Erro ao gravar dados: " + ex.Message);
}
}