protected override void OnStart(string[] args) { try { //Debugger.Launch(); LogEvent("AWE_NSS_DCM Sercice for circle " + System.Configuration.ConfigurationManager.AppSettings["CircleName"].ToString() + " getting started...", EventLogEntryType.Information); //Paco_timer.Elapsed += new System.Timers.ElapsedEventHandler(Paco_timer_Elapsed); //Paco_timer.Interval = 10000; //Paco_timer.Enabled = true; //Paco_timer.AutoReset = true; conn = new MySqlConnection(Constring); oExceptionLog = new clsExceptionLogs("Bharti_DCM_Parse_" + System.Configuration.ConfigurationManager.AppSettings["CircleName"].ToString().ToUpper()); oFileLog = new clsFileLogs("Bharti_DCM_Parse_" + System.Configuration.ConfigurationManager.AppSettings["CircleName"].ToString().ToUpper()); CS_timer.Elapsed += new System.Timers.ElapsedEventHandler(CS_timer_Elapsed); CS_timer.Interval = 10000; CS_timer.Enabled = true; CS_timer.AutoReset = true; tmrGroup1.Elapsed += new System.Timers.ElapsedEventHandler(OnTimerEventGroup1_Elapsed); tmrGroup1.Interval = 10000; tmrGroup1.Enabled = true; tmrGroup1.AutoReset = true; tmrGroup2.Elapsed += new System.Timers.ElapsedEventHandler(OnTimerEventGroup2_Elapsed); tmrGroup2.Interval = 10000; tmrGroup2.Enabled = true; tmrGroup2.AutoReset = true; tmrGroup3.Elapsed += new System.Timers.ElapsedEventHandler(OnTimerEventGroup3_Elapsed); tmrGroup3.Interval = 10000; tmrGroup3.Enabled = true; tmrGroup3.AutoReset = true; tmrGroup4.Elapsed += new System.Timers.ElapsedEventHandler(OnTimerEventGroup4_Elapsed); tmrGroup4.Interval = 10000; tmrGroup4.Enabled = true; tmrGroup4.AutoReset = true; tmrGroup5.Elapsed += new System.Timers.ElapsedEventHandler(OnTimerEventGroup5_Elapsed); tmrGroup5.Interval = 10000; tmrGroup5.Enabled = true; tmrGroup5.AutoReset = true; tmrhlrmsc.Elapsed += new System.Timers.ElapsedEventHandler(OnTimerEventHLRMSC_Elapsed); tmrhlrmsc.Interval = 1000 * 60 * 15; tmrhlrmsc.Enabled = true; tmrhlrmsc.AutoReset = true; LogEvent("AWE_NSS_DCM service for circle " + System.Configuration.ConfigurationManager.AppSettings["CircleName"].ToString() + " started successfully...", EventLogEntryType.Information); } catch (Exception e) { LogEvent(e.Message, EventLogEntryType.Error); } }
public ScriptingSSH(string Address, int Port, string User_name, string Pass_word, int CommandTimeout) { //Me.address = Address oExceptionLog = new clsExceptionLogs("Bharti_DCM_SSH"); oFileLog = new clsFileLogs("Bharti_DCM_SSH_FileLogs"); client = new TElSimpleSSHClient(); client.Address = Address; client.Port = Port; client.Username = User_name; client.Password = Pass_word; timeout = CommandTimeout; SBUtils.Unit.SetLicenseKey(SBUtils.Unit.BytesOfString("184B4EC05D9FF7847A5D2E320BBBE02459A6B654370E360720A03574465EB43DB4DE16303976FFE976CEA790A4121B22A26499520FC9DA651B9EFB1AE0ADF0A355C78A0542B04174638736CA7E453430F1A00EEDE5B66FAEEEEC962D4A14F946403AD8816E7A9A569684A3A00B2C6D381C4C0351BD3BA9087A80037CD1A18D503CC629E2C8DE45A4DB75E92138DEFF2EDE1C9B054837345C3EE397BC7B0AEDDCD1B7D2B62BDFF1C205CF32BC58F2E9854E1DAE62C18B56C3784B36443464E16944F240D888FACA9DACF29FF8704398B87AD61E6F45C46BCBA067AD74783C9EE89C5EB440CC65BBA14D0A027D60DDE23F48DC8D72AD4502F57762D20BBEE420E4")); client.Versions = 0 | SBSSHCommon.Unit.sbSSH2 | SBSSHCommon.Unit.sbSSH1; //client.AuthenticationTypes = SBSSHConstants.Unit.SSH_AUTH_TYPE_PASSWORD | SBSSHConstants.Unit.SSH_AUTH_TYPE_KEYBOARD; client.AuthenticationTypes = SBSSHConstants.Unit.SSH_AUTH_TYPE_PASSWORD | SBSSHConstants.Unit.SSH_AUTH_TYPE_KEYBOARD & ~SBSSHConstants.Unit.SSH_AUTH_TYPE_PUBLICKEY; Key_Storage.Clear(); client.KeyStorage = Key_Storage; client.OnKeyValidate += this.m_Client_OnKeyValidate; }
public MySqlConnection conn = new MySqlConnection(ConfigurationManager.AppSettings["CSDBConstring"].ToString()); // for Production // public MySqlConnection conn = new MySqlConnection("datasource=93.183.30.156;database=awe_dcm;user id=root;password=tiger;"); // For Test public clsBackupRestore() { oExceptionLog = new clsExceptionLogs("Bharti_DCM_BACKUP"); oFileLog = new clsFileLogs("Bharti_DCM_BACKUP_FileLogs"); }