public FormRunner() { InitializeComponent(); m_strDirectory = Environment.GetCommandLineArgs()[0]; m_strDirectory = m_strDirectory.Substring(0, m_strDirectory.LastIndexOf('\\')) + "\\"; m_oIniFileAccess = new IniFileAccess(m_strDirectory + "config.ini"); m_strDataDirectory = m_oIniFileAccess.ReadValue("PARAMETERS", "DATA_DIRECTORY"); if (m_strDataDirectory == "") m_strDataDirectory = m_strDirectory + "data"; webBrowserMap.ObjectForScripting = this; webBrowserMap.Url = new Uri("file://" + m_strDirectory + "map.html"); }
public void setIniFileAccess(IniFileAccess in_oIniFileAccess) { m_oIniFileAccess = in_oIniFileAccess; }
private void LoadConfig(String in_strFileName) { m_oIniFileAccess = new IniFileAccess(in_strFileName); m_lstCalendars.Clear(); m_strFrom = m_oIniFileAccess.ReadValue("mail", "from"); m_strTo = m_oIniFileAccess.ReadValue("mail", "to"); m_strToWork = m_oIniFileAccess.ReadValue("mail", "to_work"); m_strSmtp = m_oIniFileAccess.ReadValue("mail", "smtp"); m_strRabbit = m_oIniFileAccess.ReadValue("mail", "rabbit"); m_strFrom = m_oIniFileAccess.ReadValue("mail", "from"); String strLastSent = m_oIniFileAccess.ReadValue("mail", "last_sent"); String strToday = DateTime.Today.ToString("dd/MM/yyyy"); if (strToday == strLastSent) m_bSend = true; else m_bSend = false; m_oIniFileAccess.WriteValue("mail", "last_sent", strToday); int nCalendars = Convert.ToInt32(m_oIniFileAccess.ReadValue("calendar", "count")); for (int iCalendar = 1; iCalendar <= nCalendars; iCalendar++) { String strCalendar = m_oIniFileAccess.ReadValue("calendar", "calendar" + iCalendar); m_lstCalendars.Add(strCalendar); } }