示例#1
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     m_Service = new EmsService("Data Source=172.16.0.102;Initial Catalog=DBx;User ID=system;Password='******';Persist Security Info=True;");
     //m_Service = new EmsService("Data Source=10.28.33.11;Initial Catalog=DBx;User ID=emsuser;Password='******';Persist Security Info=True;");
     m_Service.ErrorCatched += new ErrorCatchedEventHandler(m_Service_ErrorCatched);
     startServiceWorker.RunWorkerAsync();
 }
示例#2
0
        public EmsWinService()
        {
            InitializeComponent();

            Properties.Settings setting = new global::EmsWinService.Properties.Settings();

            m_EmsService = new EmsService(setting.DBxConnectionString);
            m_EmsService.ErrorCatched += new ErrorCatchedEventHandler(m_EmsService_ErrorCatched);
            m_EmsService.Reported     += new EmsReportEventHandler(m_EmsService_Reported);
            m_EL        = new EventLog();
            m_EL.Source = "EmsWinService";
            m_EL.WriteEntry("Service started :=" + setting.DBxConnectionString, EventLogEntryType.Information);
        }