예제 #1
0
 protected override void OnStop()
 {
     try
     {
         Library.WriteErrorLog("\n Stop Service -" + DateTime.Now.ToString());
         ////Added by Vandna on 17-Sept-2018
         Library.WriteErrorLog("FRP Service Stop");
         Process[] _proceses = null;
         _proceses = Process.GetProcessesByName("frpc");
         foreach (Process proces in _proceses)
         {
             proces.Kill();
             proces.WaitForExit();
         }
         CLS = null;
     }
     catch (Exception ex)
     {
         Library.WriteErrorLog("FRP Service Stop Error: " + ex.Message);
     }
 }
예제 #2
0
        protected override void OnStart(string[] args)
        {
            try
            {
                Library.WriteErrorLog(" =============  Service Start ===============");

                // Register Sip SDK on client machine registry
                // RegisterSIPSDK();

                CLS = new DentalPlugin.CommonPlugin();

                // For Check LogFile size and delete log file , if size is greater than 10 MB
                DeleteLogFile();

                #region  //  Check HRDsq Tray is running or not

                if (IsProcessOpen())
                {
                    try
                    {
                        // Start HRDSQ Tray on System
                        ProcessExtensions.StartProcessAsCurrentUser(AppDomain.CurrentDomain.BaseDirectory + "\\ConvergedComm.exe", "OpenTray");
                    }
                    catch (Exception)
                    {
                        // No Need to handle this because Now PC in log off mode,We don't need to open Tray
                    }
                }

                #endregion

                // Create Reports folder in installtion directory if not exist.
                if (!Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "\\Reports"))
                {
                    Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory + "\\Reports");
                }

                #region // Get System Harddisk number and Username

                //string appPath = Directory.GetCurrentDirectory();
                //string[] aPath;
                //aPath = appPath.ToString().Trim().Split(':');
                //if (aPath.Length > 0) { appPath = aPath[0].ToString(); }
                //-----Roopal-------------
                _objHD    = new HDInfo();
                strHDInfo = clsHDInfo.MacAddress();
                //_objHD.getUniqueID("");
                Library.WriteErrorLog("HDInfo:" + strHDInfo);
                Username = GetUserName();
                Library.WriteErrorLog("Username:"******"" && !string.IsNullOrEmpty(Username))
                {
                    SetAuthDetail(strHDInfo.ToString().Trim(), Username.Trim().ToLower());
                }
            }
            catch (Exception ex)
            {
                Library.WriteErrorLog("Service Start Error :" + ex.Message);
            }
        }