Пример #1
0
        /// <returns>
        ///     -1 - something wrong
        ///     0 - successfully
        ///     1 - job agent is offline
        /// </returns>
        public static int SetJobProperty(string strPropName, string strPropValue)
        {
            int iRet = 0;

            if (ms_jobStatusManager == null)
            {
                return(-1);
            }
            try
            {
                int iProcessId = Process.GetCurrentProcess().Id;
                if (ms_jobStatusManager.SetJobProperty(iProcessId, strPropName, strPropValue) != 0)
                {
                    iRet = -1;
                }
            }
            catch (System.Net.Sockets.SocketException)
            {
                iRet = 1;
            }
            catch (Exception)
            {
                iRet = -1;
            }

            return(iRet);
        }