本文整理汇总了C#中IniFile.ReadInteger方法的典型用法代码示例。如果您正苦于以下问题:C# IniFile.ReadInteger方法的具体用法?C# IniFile.ReadInteger怎么用?C# IniFile.ReadInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IniFile
的用法示例。
在下文中一共展示了IniFile.ReadInteger方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: carregarDados
/*******************************************************************************************************************************************/
private void carregarDados()
{
if (File.Exists("./Config.ini"))
{
var iniFile = new IniFile("./Config.ini");
txtQtdeLote.Value = iniFile.ReadInteger("Configuracao", "QtdeEmailBloco");
txtIntevaloLote.Value = iniFile.ReadInteger("Configuracao", "IntevaloLote");
txtIntevaloEmail.Value = iniFile.ReadInteger("Configuracao", "IntevaloEmail");
txtQtdeEmailScript.Value = iniFile.ReadInteger("Configuracao", "QtdeEmailScript");
txtNomeRemetente.Text = iniFile.ReadString("Configuracao", "NomeRemetente");
if (File.Exists("./Mailing.txt"))
{
string[] lines = File.ReadAllLines(@"./Mailing.txt");
foreach (string line in lines)
{
dgvArquivos.Rows.Add(false, line);
}
}
if (File.Exists("./Script.txt"))
{
string[] lines = File.ReadAllLines(@"./Script.txt");
foreach (string line in lines)
{
dgvScripts.Rows.Add(false, line);
}
}
}
}
示例2: Initialize
/// <summary>
/// Loading file from filePath and store all information.
/// </summary>
/// <param name="filePath">File path.</param>
/// <param name="newImport">True when data should be read again from original file</param>
/// <remarks>Gets recalled on filePath change!</remarks>
public override void Initialize(string filePath, bool newImport = true)
{
base.Initialize(filePath, newImport);
IniFile ini = new IniFile(filePath);
// set file pathes
string path = Path.GetDirectoryName(filePath);
filenames["Intensity"] = String.Format("{0}/{1}", path, ini.ReadString("buffers", "intensity"));
filenames["Topography"] = String.Format("{0}/{1}", path, ini.ReadString("buffers", "topography"));
filenames["Color"] = String.Format("{0}/{1}", path, ini.ReadString("buffers", "color"));
if (newImport) {
size = new Xwt.Size(ini.ReadInteger("general", "Width", 0), ini.ReadInteger("general", "Height", 0));
requestedBitmapSize = new Xwt.Size(size.Width, size.Height);
List<Tuple<string, string>> generalData = ini.ReadAllStrings("general");
foreach (Tuple<string, string > datum in generalData) {
try {
metadata[datum.Item1] =
float.Parse(datum.Item2, System.Globalization.CultureInfo.CreateSpecificCulture("en-us"));
} catch (Exception e) {
Console.WriteLine(e.Message);
Console.WriteLine(e.StackTrace);
}
}
}
}
示例3: carregarDados
/*******************************************************************************************************************************************/
public void carregarDados()
{
if (File.Exists("./Config.ini"))
{
this.QtdeEmail = 0;
this.QtdeAssuntos = 0;
this.CorpoEmail = null;
this.listaAssunto.Clear();
this.listaMailing.Clear();
var iniFile = new IniFile("./Config.ini");
this.QtdeBlocos = iniFile.ReadInteger("Configuracao", "QtdeEmailBloco");
this.QtdeScript = iniFile.ReadInteger("Configuracao", "QtdeEmailScript");
this.IntevaloLote = iniFile.ReadInteger("Configuracao", "IntevaloLote");
this.IntevaloEmail = iniFile.ReadInteger("Configuracao", "IntevaloEmail");
this.Remetente = iniFile.ReadString("Configuracao", "NomeRemetente");
this.Diretorio = iniFile.ReadString("Configuracao", "Diretorio");
var assunto1 = iniFile.ReadString("Assunto", "assunto1");
if (assunto1 != "")
{
listaAssunto.Add(assunto1);
}
var assunto2 = iniFile.ReadString("Assunto", "assunto2");
if (assunto2 != "")
{
listaAssunto.Add(assunto2);
}
var assunto3 = iniFile.ReadString("Assunto", "assunto3");
if (assunto3 != "")
{
listaAssunto.Add(assunto3);
}
if (File.Exists("./Mailing.txt"))
{
string[] lines = File.ReadAllLines(@"./Mailing.txt");
foreach (string line in lines)
{
listaMailing.Add(line);
}
}
List<DataGridViewRow> toDelete = new List<DataGridViewRow>();
dgvHost.EndEdit();
foreach (DataGridViewRow row in dgvHost.Rows)
{
toDelete.Add(row);
}
foreach (DataGridViewRow row in toDelete)
{
dgvHost.Rows.Remove(row);
}
if (File.Exists("./Script.txt"))
{
string[] lines = File.ReadAllLines(@"./Script.txt");
foreach (string line in lines)
{
listaScript.Add(line);
dgvHost.Rows.Add(line);
}
}
if (File.Exists("./Email.txt"))
{
string[] lines = File.ReadAllLines(@"./Email.txt");
foreach (string line in lines)
{
this.CorpoEmail += line;
}
}
this.QtdeEmail = listaMailing.Count();
this.QtdeAssuntos = listaAssunto.Count();
dgvHost.Rows.Add(Url);
statusStrip.Items[7].Text = Convert.ToString(this.QtdeAssuntos);
statusStrip.Items[9].Text = Convert.ToString(this.QtdeEmail);
}
else
{
MessageBox.Show("Não foi possível encontrar o arquivo de configuração! \nFavor configurar todas as opções do sistema.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
示例4: API_ConfigGetLinkProfile
public Result API_ConfigGetLinkProfile(
[In] UInt32 profileIdx,
[In, Out] RadioLinkProfile profileInfo
)
{
#if _TRACE_OUT_PUT
PrintMagToTxt("API_ConfigGetLinkProfile");
#endif
// regionComboBox
IniFile clsIni = null;
string strIndex = profileIdx.ToString();
clsIni = new IniFile(System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase
+ "LinkProfile.ini");
if (null == clsIni) return Result.FAILURE;
profileInfo.enabled = clsIni.ReadInteger(strIndex, "Enabled", 0);
profileInfo.profileId = clsIni.ReadInteger64(strIndex, "ProfileId", 0);
profileInfo.profileVersion = clsIni.ReadInteger(strIndex, "ProfileVersion", 0);
profileInfo.denseReaderMode = clsIni.ReadInteger(strIndex, "DenseReaderMode", 0);
profileInfo.widebandRssiSamples = clsIni.ReadInteger(strIndex, "WidebandRssiSamples", 0);
profileInfo.narrowbandRssiSamples = clsIni.ReadInteger(strIndex, "NarrowbandRssiSamples", 0);
profileInfo.realtimeRssiEnabled = clsIni.ReadInteger(strIndex, "RealtimeRssiEnabled", 0);
profileInfo.realtimeWidebandRssiSamples = clsIni.ReadInteger(strIndex, "RealtimeWidebandRssiSamples", 0);
profileInfo.realtimeNarrowbandRssiSamples = clsIni.ReadInteger(strIndex, "RealtimeNarrowbandRssiSamples", 0);
if (RadioProtocol.ISO18K6C == profileInfo.profileProtocol)
{
RadioLinkProfileConfig_ISO18K6C profileConfig =
new RadioLinkProfileConfig_ISO18K6C();
profileConfig.data01Difference = (DataDifference)clsIni.ReadInteger(strIndex, "Data01Difference", 0);
profileConfig.divideRatio = (DivideRatio)clsIni.ReadInteger(strIndex, "DivideRatio", 0);
profileConfig.millerNumber = (MillerNumber)clsIni.ReadInteger(strIndex, "MillerNumber", 0);
profileConfig.minT2Delay = clsIni.ReadInteger(strIndex, "MinT2Delay", 0);
profileConfig.modulationType = (ModulationType)clsIni.ReadInteger(strIndex, "ModulationType", 0);
profileConfig.pulseWidth = clsIni.ReadInteger(strIndex, "PulseWidth", 0);
profileConfig.rtCalibration = clsIni.ReadInteger(strIndex, "RtCalibration", 0);
profileConfig.rxDelay = clsIni.ReadInteger(strIndex, "RxDelay", 0);
profileConfig.tari = clsIni.ReadInteger(strIndex, "Tari", 0);
profileConfig.trCalibration = clsIni.ReadInteger(strIndex, "TrCalibration", 0);
profileConfig.trLinkFrequency = clsIni.ReadInteger(strIndex, "TrLinkFrequency", 0);
profileConfig.txPropagationDelay = clsIni.ReadInteger(strIndex, "TxPropagationDelay", 0);
profileConfig.varT2Delay = clsIni.ReadInteger(strIndex, "VarT2Delay", 0);
profileInfo.profileConfig = profileConfig;
}
else
{
// This will set the value of profile.profileProtocol field
// to be set to UNKNOWN - i.e. library / linkage mis-match
profileInfo.profileConfig = new ProfileConfig();
}
return Result.OK;
}