예제 #1
0
        /// <summary>
        /// 保存配置类实例
        /// </summary>
        /// <param name="emailconfiginfo"></param>
        /// <returns></returns>
        public static bool SaveConfig(EmailConfigInfo emailconfiginfo)
        {
            EmailConfigFileManager ecfm = new EmailConfigFileManager();

            EmailConfigFileManager.ConfigInfo = emailconfiginfo;
            return(ecfm.SaveConfig());
        }
예제 #2
0
파일: Emails.cs 프로젝트: ichari/ichari
 //重设置当前邮件发送类的实例对象
 public static void ReSetISmtpMail()
 {
     try
     {
         emailinfo = EmailConfigs.GetConfig();
         //读取相应的DLL信息
         Assembly asm = Assembly.LoadFrom(HttpRuntime.BinDirectory + emailinfo.DllFileName);
         ESM = (ISmtpMail)Activator.CreateInstance(asm.GetType(emailinfo.PluginNameSpace, false, true));
     }
     catch
     {
         try
         {
             //读取相应的DLL信息
             Assembly asm = Assembly.LoadFrom(Utils.GetMapPath("/bin/" + emailinfo.DllFileName));
             ESM = (ISmtpMail)Activator.CreateInstance(asm.GetType(emailinfo.PluginNameSpace, false, true));
         }
         catch
         {
             ESM = new SmtpMail();
         }
     }
 }
예제 #3
0
 /// <summary>
 /// 保存配置类实例
 /// </summary>
 /// <param name="emailconfiginfo"></param>
 /// <returns></returns>
 public static bool SaveConfig(EmailConfigInfo emailconfiginfo)
 {
     EmailConfigFileManager ecfm = new EmailConfigFileManager();
     EmailConfigFileManager.ConfigInfo = emailconfiginfo;
     return ecfm.SaveConfig();
 }
예제 #4
0
파일: Emails.cs 프로젝트: khaliyo/DiscuzNT
        //重设置当前邮件发送类的实例对象
        public static void ReSetISmtpMail()
        {            
           emailinfo = EmailConfigs.GetConfig();

           LoadEmailPlugin();
        }
 /// <summary>
 /// 初始化文件修改时间和对象实例
 /// </summary>
 static EmailConfigFileManager()
 {
     m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);
     m_configinfo = (EmailConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(EmailConfigInfo));
 }
 /// <summary>
 /// 初始化文件修改时间和对象实例
 /// </summary>
 static EmailConfigFileManager()
 {
     m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);
     m_configinfo    = (EmailConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(EmailConfigInfo));
 }