示例#1
0
        public static void SaveVersionInfo(UpgradeVersions versionInfo)
        {
            //读取JSON配置文件
            var jsonFile = new FileInfo(HttpContext.Current.Server.MapPath(configSavePath));

            jsonFile.Delete();

            var jsonStr = JsonConvert.SerializeObject(versionInfo);
            var jsonBytes = System.Text.Encoding.UTF8.GetBytes(jsonStr);

            var fileReader = jsonFile.OpenWrite();
            fileReader.Write(jsonBytes, 0, jsonBytes.Length);

            fileReader.Flush();
            fileReader.Close();
        }
示例#2
0
        public static void SaveVersionInfo(UpgradeVersions versionInfo)
        {
            //读取JSON配置文件
            var jsonFile = new FileInfo(HttpContext.Current.Server.MapPath(configSavePath));

            jsonFile.Delete();

            var jsonStr   = JsonConvert.SerializeObject(versionInfo);
            var jsonBytes = System.Text.Encoding.UTF8.GetBytes(jsonStr);


            var fileReader = jsonFile.OpenWrite();

            fileReader.Write(jsonBytes, 0, jsonBytes.Length);

            fileReader.Flush();
            fileReader.Close();
        }