示例#1
0
 /// <summary>
 /// 设置服务配置项
 /// </summary>
 /// <param name="strAdminKey"></param>
 /// <param name="config"></param>
 /// <returns></returns>
 public RI_Result SetServiceConfiguration(string strAdminKey, RI_Configuration config)
 {
     try
     {
         if (strAdminKey == null || string.Compare(strAdminKey.Trim(),
                                                   Common.Config("Authorization", "AdminKey").Trim()) != 0)
         {
             Common.Log("UnAuthorized Remoting Key [" + strAdminKey.Trim() + "].");
             return(RI_Result.Unauthorized);
         }
         else if (!Common.Switch_Configuration)
         {
             Common.Log("The Interface [ServiceConfiguration] Is Closed.");
             return(RI_Result.Closed_Interface);
         }
         RI_Result Rtn = Management.SetConfiguration(config);
         if (Rtn == RI_Result.Success)
         {
             Common.Log("The Configuration Settings Have Been Changed.");
         }
         return(Rtn);
     }
     catch (Exception err)
     {
         Common.Log(err);
         return(RI_Result.Internal_Error);
     }
 }
示例#2
0
 /// <summary>
 /// 设置服务配置项
 /// </summary>
 /// <param name="strAdminKey"></param>
 /// <param name="config"></param>
 /// <returns></returns>
 public RI_Result SetServiceConfiguration(string strAdminKey, RI_Configuration config)
 {
     try
     {
         if (strAdminKey == null || string.Compare(strAdminKey.Trim(),
             Common.Config("Authorization", "AdminKey").Trim()) != 0)
         {
             Common.Log("UnAuthorized Remoting Key [" + strAdminKey.Trim() + "].");
             return RI_Result.Unauthorized;
         }
         else if (!Common.Switch_Configuration)
         {
             Common.Log("The Interface [ServiceConfiguration] Is Closed.");
             return RI_Result.Closed_Interface;
         }
         RI_Result Rtn = Management.SetConfiguration(config);
         if (Rtn == RI_Result.Success)
             Common.Log("The Configuration Settings Have Been Changed.");
         return Rtn;
     }
     catch (Exception err)
     {
         Common.Log(err);
         return RI_Result.Internal_Error;
     }
 }