Esempio n. 1
0
        private void CreateCPSettings()
        {
            DataView dvCpSetting   = (DataView)SqlDataSourceCpSetting.Select(DataSourceSelectArguments.Empty);
            String   jsonCpSetting = ToJson(dvCpSetting);
            //TextBox1.Text = jsonCpSetting;
            String SDKPackageDir = System.Configuration.ConfigurationManager.AppSettings["SDKPackageDir"];
            string filePatch     = SDKPackageDir + "Config\\" + GameName + "\\" + PlatformName;

            if (!System.IO.Directory.Exists(filePatch))
            {
                System.IO.Directory.CreateDirectory(filePatch);
            }
            String       fileCpSetting = filePatch + "\\CPSettings.txt";
            StreamWriter sw            = new StreamWriter(fileCpSetting, false, Encoding.UTF8);

            sw.Write(jsonCpSetting);
            sw.Close();
        }
        private void CreateCPSettings()
        {
            DataView dvCpSetting   = (DataView)SqlDataSourceCpSetting.Select(DataSourceSelectArguments.Empty);
            String   jsonCpSetting = ToJson(dvCpSetting);
            //TextBox1.Text = jsonCpSetting;
            string system        = GameRequest.GetQueryString("systemid");
            String SDKPackageDir = string.Empty;
            string filePatch     = string.Empty;

            if (system == "1")
            {
                SDKPackageDir = System.Configuration.ConfigurationManager.AppSettings["SDKAndroidPackageConfig"];
                filePatch     = SDKPackageDir + gameid + "\\" + GameRequest.GetQueryString("platformname");
            }
            else
            {
                //IOS不确定
                SDKPackageDir = System.Configuration.ConfigurationManager.AppSettings["SDKIOSPackageConfig"]; //System.Configuration.ConfigurationManager.AppSettings["SDKAndroidPackageConfig"];
                filePatch     = SDKPackageDir + gameid + "\\sdk_res_" + GameRequest.GetQueryString("platformname") + "\\cpsettings";
            }
            //string system = GameRequest.GetQueryString("systemid") == "1" ? "Android\\" : "IOS\\";

            if (pluginid == "1")
            {
                filePatch += "_LeBian";
            }
            if (!System.IO.Directory.Exists(filePatch))
            {
                System.IO.Directory.CreateDirectory(filePatch);
            }
            String       fileCpSetting = filePatch + "\\CPSettings.txt";
            StreamWriter sw            = new StreamWriter(fileCpSetting, false, Encoding.UTF8);

            sw.Write(jsonCpSetting);
            sw.Close();
        }