예제 #1
0
        private bool SaveConfig(out string errorMsg)
        {
            bool result;

            try
            {
                Configuration configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(base.Request.ApplicationPath);
                using (System.Security.Cryptography.RijndaelManaged cryptographer = this.GetCryptographer())
                {
                    configuration.AppSettings.Settings["IV"].Value  = System.Convert.ToBase64String(cryptographer.IV);
                    configuration.AppSettings.Settings["Key"].Value = System.Convert.ToBase64String(cryptographer.Key);
                }
                System.Web.Configuration.MachineKeySection machineKeySection = (System.Web.Configuration.MachineKeySection)configuration.GetSection("system.web/machineKey");
                machineKeySection.ValidationKey = Install.CreateKey(20);
                machineKeySection.DecryptionKey = Install.CreateKey(24);
                machineKeySection.Validation    = System.Web.Configuration.MachineKeyValidation.SHA1;
                machineKeySection.Decryption    = "3DES";
                configuration.ConnectionStrings.ConnectionStrings["HidistroSqlServer"].ConnectionString = this.GetConnectionString();
                configuration.ConnectionStrings.SectionInformation.ProtectSection("DataProtectionConfigurationProvider");
                configuration.Save();
                errorMsg = null;
                result   = true;
            }
            catch (System.Exception ex)
            {
                errorMsg = ex.Message;
                result   = false;
            }
            return(result);
        }
예제 #2
0
 private bool SaveSiteSettings(out string errorMsg)
 {
     errorMsg = null;
     if (this.siteName.Length > 30 || this.siteDescription.Length > 30)
     {
         errorMsg = "网店名称和简单介绍的长度不能超过30个字符";
         return(false);
     }
     try
     {
         XmlDocument xmlDocument = new XmlDocument();
         xmlDocument.XmlResolver = null;
         SiteSettings siteSettings = new SiteSettings();
         siteSettings.SiteUrl         = base.Request.Url.Host;
         siteSettings.AliOHServerUrl  = "https://openapi.alipay.com/gateway.do";
         siteSettings.SiteName        = this.siteName;
         siteSettings.SiteDescription = this.siteDescription;
         siteSettings.CheckCode       = Install.CreateKey(20);
         siteSettings.AppKey          = this.CreateAppKey();
         siteSettings.InstallDate     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
         this.InitMasterSettings(siteSettings);
         this.RegisterERP(siteSettings.AppKey, siteSettings.CheckCode);
         return(true);
     }
     catch (Exception ex)
     {
         errorMsg = ex.Message;
         return(false);
     }
 }
예제 #3
0
 private bool SaveConfig(out string errorMsg)
 {
     try
     {
         Configuration configuration = WebConfigurationManager.OpenWebConfiguration(base.Request.ApplicationPath);
         configuration.AppSettings.Settings.Remove("Installer");
         using (RijndaelManaged rijndaelManaged = this.GetCryptographer())
         {
             configuration.AppSettings.Settings["IV"].Value  = Convert.ToBase64String(rijndaelManaged.IV);
             configuration.AppSettings.Settings["Key"].Value = Convert.ToBase64String(rijndaelManaged.Key);
         }
         MachineKeySection machineKeySection = (MachineKeySection)configuration.GetSection("system.web/machineKey");
         machineKeySection.ValidationKey = Install.CreateKey(20);
         machineKeySection.DecryptionKey = Install.CreateKey(24);
         machineKeySection.Validation    = MachineKeyValidation.SHA1;
         machineKeySection.Decryption    = "3DES";
         configuration.ConnectionStrings.ConnectionStrings["HidistroSqlServer"].ConnectionString = this.GetConnectionString();
         configuration.ConnectionStrings.SectionInformation.ProtectSection("DataProtectionConfigurationProvider");
         configuration.Save();
         errorMsg = null;
         return(true);
     }
     catch (Exception ex)
     {
         errorMsg = ex.Message;
         return(false);
     }
 }
예제 #4
0
파일: Install.cs 프로젝트: tyriankid/WFX
        private bool SaveSiteSettings(out string errorMsg)
        {
            errorMsg = null;
            bool result;

            try
            {
                string       filename = base.Request.MapPath(Globals.ApplicationPath + "/config/SiteSettings.config");
                XmlDocument  doc      = new XmlDocument();
                SiteSettings settings = new SiteSettings(base.Request.Url.Host);
                doc.LoadXml("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + System.Environment.NewLine + "<Settings></Settings>");
                settings.CheckCode = Install.CreateKey(20);
                settings.ApplicationDescription   = "<img src=\"/Storage/master/gallery/201501/20150114091939_5651.jpg\" title=\"20150114091939_5651\" alt=\"20150114091939_5651\" border=\"0\" />";
                settings.SaleService             += "<div class=\"sale-service clearfix\">";
                settings.SaleService             += "<a href=\"http://wpa.b.qq.com/cgi/wpa.php?ln=2&amp;uin=123456789\" class=\"col-sm-4\" target=\"_blank\">";
                settings.SaleService             += "  <img src=\"/Storage/master/gallery/201501/20150112160440_7779.png\" title=\"QQ_service\" alt=\"QQ_service\" border=\"0\" /></a>   ";
                settings.SaleService             += "<a href=\"http://wpa.b.qq.com/cgi/wpa.php?ln=2&amp;uin=450235251\" target=\"_blank\" class=\"col-sm-4\"><img src=\"/Storage/master/gallery/201501/20150112160517_9570.png\" title=\"QQ_service\" alt=\"QQ_service\" border=\"0\" /></a>   ";
                settings.SaleService             += " <a href=\"\" http:=\"\" wpa.qq.com=\"\" msgrd?v=\"3&amp;uin=&amp;site=qq&amp;menu=yes\" \"=\"\" class=\"col-sm-4\"><img src=\"/Storage/master/gallery/201501/20150112160440_7779.png\" /></a> </div> ";
                settings.SaleService             += "<a type=\"button\" class=\"btn btn-danger btn-block\" href=\"tel:18211111111\">服务电话:18211111111</a>";
                settings.DistributorBackgroundPic = "/Storage/data/DistributorBackgroundPic/default.jpg|";
                settings.MentionNowMoney          = "1";
                settings.DistributorDescription  += "<p>微信分销的功课:</p>";
                settings.DistributorDescription  += "<p>1.研究兴趣取向:通过观察和研究他们发布的朋友圈,了解他们可能会被我们产品的那一方面打动,整合我们产品的特点,激发他们的兴趣。&nbsp;</p>";
                settings.DistributorDescription  += "<p>2.推送信息:根据他们的兴趣特点来发布信息;字数不宜超过20字;要留悬念,让他们主动发问;图文并茂;</p>";
                settings.DistributorDescription  += "<p>3.每天不要超过三条,更不要同时发送,选择的热度时间不同微信不一样,方法是观察朋友圈在哪段时间大家发微信比较勤奋,比他们的时间早5分钟左右发布。</p>";
                settings.DistributorDescription  += "<p><span style=\"line-height:1.5;\">4.因为一般人的习惯是先看后发。最初,要学会烘托气氛,当我们开始做朋友圈营销的时候,一定不能做的像一个新手一样,发图片,然后写一些介绍。</span></p>";
                settings.DistributorDescription  += "<p>微信分销的五要点&nbsp;</p>";
                settings.DistributorDescription  += "<p>第一建立一个信任度;</p>";
                settings.DistributorDescription  += "<p>第二呢第一时间让对方感兴趣;</p>";
                settings.DistributorDescription  += "<p>第三点呢就是顾客的二次营销;&nbsp;</p>";
                settings.DistributorDescription  += "<p>第四点呢互动;";
                settings.DistributorDescription  += "第五个呢老顾客的忠诚和信息的推广;</p>";
                settings.OpenManyService          = false;
                settings.WriteToXml(doc);
                doc.Save(filename);
                result = true;
            }
            catch (System.Exception exception)
            {
                errorMsg = exception.Message;
                result   = false;
            }
            return(result);
        }
예제 #5
0
        private bool SaveSiteSettings(out string errorMsg)
        {
            errorMsg = null;
            bool result;

            try
            {
                string       filename     = base.Request.MapPath(Globals.ApplicationPath + "/config/SiteSettings.config");
                XmlDocument  xmlDocument  = new XmlDocument();
                SiteSettings siteSettings = new SiteSettings(base.Request.Url.Host);
                xmlDocument.LoadXml("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + System.Environment.NewLine + "<Settings></Settings>");
                siteSettings.VTheme                      = "t1";
                siteSettings.SiteName                    = this.hdfSiteName.Value.Trim();
                siteSettings.CheckCode                   = Install.CreateKey(20);
                siteSettings.DistributorLogoPic          = "/utility/pics/headLogo.jpg";
                siteSettings.DistributorsMenu            = true;
                siteSettings.EnableShopMenu              = true;
                siteSettings.ShopDefault                 = true;
                siteSettings.MemberDefault               = true;
                siteSettings.GoodsType                   = true;
                siteSettings.GoodsCheck                  = true;
                siteSettings.ActivityMenu                = true;
                siteSettings.ActivityMenu                = true;
                siteSettings.BrandMenu                   = true;
                siteSettings.GoodsListMenu               = true;
                siteSettings.OrderShowDays               = 7;
                siteSettings.CloseOrderDays              = 3;
                siteSettings.FinishOrderDays             = 7;
                siteSettings.MaxReturnedDays             = 15;
                siteSettings.TaxRate                     = 0m;
                siteSettings.PointsRate                  = 1m;
                siteSettings.IsValidationService         = true;
                siteSettings.SMSSender                   = "";
                siteSettings.SMSSettings                 = "";
                siteSettings.ShopMenuStyle               = "1";
                siteSettings.EnablePodRequest            = false;
                siteSettings.EnableCommission            = true;
                siteSettings.EnableAlipayRequest         = false;
                siteSettings.EnableWeiXinRequest         = false;
                siteSettings.EnableOffLineRequest        = true;
                siteSettings.EnableWapShengPay           = false;
                siteSettings.OffLinePayContent           = "<p>请填写在线支付帮助内容</p>";
                siteSettings.DistributorDescription      = "<p><img src=\"/utility/pics/fxs.png\" title=\"fenxiao.png\" alt=\"fenxiao.png\"/></p>";
                siteSettings.DistributorBackgroundPic    = "/Storage/data/DistributorBackgroundPic/default.jpg|";
                siteSettings.SaleService                 = "<p>请填写售后服务内容</p>";
                siteSettings.MentionNowMoney             = "1";
                siteSettings.PointsRate                  = 1m;
                siteSettings.PointsRate                  = 1m;
                siteSettings.Disabled                    = false;
                siteSettings.ShareAct_Enable             = true;
                siteSettings.SignPoint                   = 10;
                siteSettings.SignWherePoint              = 10;
                siteSettings.SignWhere                   = 10;
                siteSettings.ActiveDay                   = 1;
                siteSettings.sign_EverDayScore           = 50;
                siteSettings.sign_StraightDay            = 2;
                siteSettings.sign_RewardScore            = 20;
                siteSettings.sign_score_Enable           = true;
                siteSettings.shopping_reward_Enable      = true;
                siteSettings.shopping_score_Enable       = true;
                siteSettings.shopping_Score              = 100;
                siteSettings.shopping_reward_Score       = 1;
                siteSettings.shopping_reward_OrderValue  = 100.0;
                siteSettings.share_score_Enable          = true;
                siteSettings.share_Score                 = 100;
                siteSettings.PointToCashRate             = 100;
                siteSettings.PonitToCash_Enable          = true;
                siteSettings.PonitToCash_MaxAmount       = 1000m;
                siteSettings.DrawPayType                 = "1|0|2|3";
                siteSettings.BatchAliPay                 = true;
                siteSettings.BatchWeixinPay              = true;
                siteSettings.BatchWeixinPayCheckRealName = 0;
                siteSettings.EnableSaleService           = false;
                siteSettings.ServiceMeiQia               = "";
                siteSettings.App_Secret                  = "836e49139e90c64f21251a6dec9c2cca";
                siteSettings.WriteToXml(xmlDocument);
                xmlDocument.Save(filename);
                result = true;
            }
            catch (System.Exception ex)
            {
                errorMsg = ex.Message;
                result   = false;
            }
            return(result);
        }