public void loadSetup() { string fileName = System.AppDomain.CurrentDomain.BaseDirectory + "hl7service.ini"; if (File.Exists(fileName) == false) { createDefaultIni(fileName); } inifile ini = new inifile(fileName); folder = ini.getValue("service", "folder", "/tmp/hl7"); port = ini.getValue("service", "port", 8901); csv_field_delimiter = ini.getValue("service", "csv", ",")[0]; // Check that receiving folder exists, if not we create it if (!Directory.Exists(folder)) { Directory.CreateDirectory(folder); } }
public void loadIni(string fileName) { // Get SQL Server connection info from INI file (or use defaults) inifile ini = new inifile(System.AppDomain.CurrentDomain.BaseDirectory + fileName); this.user = ini.getValue("database", "user", "sa"); this.password = ini.getValue("database", "password", "123456"); this.server_url = ini.getValue("database", "server_url", "192.168.1.3\\SQLEXPRESS"); this.trusted_connection = ini.getValue("database", "trusted_connection", true); this.database = ini.getValue("database", "database", "SCA5t"); this.timeout = ini.getValue("database", "timeout", 30); connectionString = "Data Source=" + server_url + ";Initial Catalog=" + database + ";User Id=" + user + ";Password=" + password; }