本文整理汇总了C#中IniFile.ParseFileReadValue方法的典型用法代码示例。如果您正苦于以下问题:C# IniFile.ParseFileReadValue方法的具体用法?C# IniFile.ParseFileReadValue怎么用?C# IniFile.ParseFileReadValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IniFile
的用法示例。
在下文中一共展示了IniFile.ParseFileReadValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialise
/// <summary>
/// <para>Initialises Inventory interface</para>
/// <para>
/// <list type="bullet">
/// <item>Loads and initialises the MySQL storage plugin</item>
/// <item>warns and uses the obsolete mysql_connection.ini if connect string is empty.</item>
/// <item>Check for migration</item>
/// </list>
/// </para>
/// </summary>
/// <param name="connect">connect string</param>
public void Initialise(string connect)
{
if (connect != String.Empty)
{
database = new MySQLManager(connect);
}
else
{
m_log.Warn("Reverting to deprecated mysql_connection.ini file for connection info");
IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini");
string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname");
string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database");
string settingUsername = GridDataMySqlFile.ParseFileReadValue("username");
string settingPassword = GridDataMySqlFile.ParseFileReadValue("password");
string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling");
string settingPort = GridDataMySqlFile.ParseFileReadValue("port");
rollbackDir = GridDataMySqlFile.ParseFileReadValue("rollbackdir");
rollbackStore = GridDataMySqlFile.ParseFileReadValue("rollback") == "true";
opengridmode = GridDataMySqlFile.ParseFileReadValue("opengridmode") == "true";
if (rollbackStore)
m_log.Warn("[MysqlInventory] Enabling rollback mode in: " + rollbackDir);
database =
new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling,
settingPort);
}
// This actually does the roll forward assembly stuff
Assembly assem = GetType().Assembly;
Migration m = new Migration(database.Connection, assem, "InventoryStore");
m.Update();
}
示例2: Initialise
/// <summary>
/// Initialises the region datastore
/// </summary>
/// <param name="connectionString">The connection string.</param>
public void Initialise(string connectionString)
{
if (!string.IsNullOrEmpty(connectionString))
{
_Database = new MSSQLManager(connectionString);
}
else
{
IniFile iniFile = new IniFile("mssql_connection.ini");
string settingDataSource = iniFile.ParseFileReadValue("data_source");
string settingInitialCatalog = iniFile.ParseFileReadValue("initial_catalog");
string settingPersistSecurityInfo = iniFile.ParseFileReadValue("persist_security_info");
string settingUserId = iniFile.ParseFileReadValue("user_id");
string settingPassword = iniFile.ParseFileReadValue("password");
_Database = new MSSQLManager(settingDataSource, settingInitialCatalog, settingPersistSecurityInfo, settingUserId, settingPassword);
}
//Migration settings
_Database.CheckMigration(_migrationStore);
}