Beispiel #1
0
        /// <summary>
        /// 挂载皮肤
        /// </summary>
        /// <param name="model"></param>
        public Skin SkinMount(Skin model)
        {
            var gameskin = Game.SkinFile(model);
            var softskin = Soft.SkinFile(model);

            if (!File.Exists(softskin))
            {
                MessageBox.Show("皮肤 [" + model.SkinName + "]文件丢失", "挂载失败");
            }
            try
            {
                if (FileOperations.CreateFileDir(gameskin) && ReadOrWriteClientZipstxt(model, true))
                {
                    File.Copy(softskin, gameskin, true);
                    model.MountType = "已挂载";
                    _skin.ChangeMountType(model);
                }
                else
                {
                    MessageBox.Show("ClientZips.txt文件读写失败!请确认改文件未被锁定", "挂载失败!");
                }
            }
            catch (Exception ex)
            {
                ReadOrWriteClientZipstxt(model, false);
                MessageBox.Show("皮肤复制出错!\r\n文件被占用或无权限操作", "挂载失败!");
                Log.LogError("挂载皮肤", ex);
            }
            return(model);
        }