添加项目文件。
This commit is contained in:
@@ -0,0 +1,158 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
string uploadsPath = @"F:\Temp\Template0524\AdminSrc\AdminHost\wwwroot\uploads";
|
||||
|
||||
var propMapping = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
// 40001-40006
|
||||
{ "改名卡", "40001" },
|
||||
{ "大喇叭", "40002" },
|
||||
{ "冰冻", "40003" },
|
||||
{ "狂暴", "40004" },
|
||||
{ "刮刮卡", "40005" },
|
||||
{ "召唤卡", "40006" },
|
||||
|
||||
{ "Vip1专属炮台", "40100" },
|
||||
{ "Vip2专属炮台", "40101" },
|
||||
{ "Vip3专属炮台", "40102" },
|
||||
{ "Vip4专属炮台", "40103" },
|
||||
{ "Vip5专属炮台", "40104" },
|
||||
{ "Vip6专属炮台", "40105" },
|
||||
{ "Vip7专属炮台", "40106" },
|
||||
{ "Vip8专属炮台", "40107" },
|
||||
{ "Vip9专属炮台", "40108" },
|
||||
{ "Vip10专属炮台", "40109" },
|
||||
|
||||
{ "雷电之翼", "40201" },
|
||||
{ "烈焰之翼", "40202" },
|
||||
{ "暴风之翼", "40203" },
|
||||
{ "幻翎之翼", "40204" },
|
||||
{ "裂变之翼", "40205" },
|
||||
{ "火龙之翼", "40206" },
|
||||
{ "神圣之翼", "40207" },
|
||||
{ "幻隐之翼", "40208" },
|
||||
{ "凤羽之翼", "40209" },
|
||||
|
||||
{ "鸿运招财喵", "40301" },
|
||||
{ "极限大黄蜂", "40302" },
|
||||
{ "福禄柴犬", "40303" },
|
||||
{ "哪吒转世", "40304" },
|
||||
{ "五福熊猫", "40305" },
|
||||
{ "九天雷龙", "40306" },
|
||||
{ "万圣通灵", "40307" },
|
||||
{ "三昧真火", "40308" },
|
||||
{ "不朽战神", "40309" },
|
||||
|
||||
{ "乘风破浪", "40210" },
|
||||
{ "五谷丰登", "40211" },
|
||||
{ "傲游太虚", "40212" },
|
||||
{ "光棱杀手", "40213" },
|
||||
{ "八卦神炉", "40214" },
|
||||
{ "冰火回响", "40215" },
|
||||
{ "冰霜巨龙", "40216" },
|
||||
{ "刀光剑影", "40217" },
|
||||
{ "刑天魔斧", "40218" },
|
||||
{ "创世之心", "40219" },
|
||||
{ "创世幻翼", "40220" },
|
||||
{ "剑气如虹", "40221" },
|
||||
{ "圣光之剑", "40222" },
|
||||
{ "圣洁之心", "40223" },
|
||||
{ "堕天使之翼", "40224" },
|
||||
{ "天下无极", "40225" },
|
||||
{ "天机神鹰", "40226" },
|
||||
{ "如虎添翼", "40227" },
|
||||
{ "审判之光", "40228" },
|
||||
{ "巨蟹之翼", "40229" },
|
||||
{ "幻蝶彩翼", "40230" },
|
||||
{ "幽冥飞刃", "40231" },
|
||||
{ "心心相印", "40232" },
|
||||
{ "战旗之翼", "40233" },
|
||||
{ "战神之怒", "40234" },
|
||||
{ "战魂之刃", "40235" },
|
||||
{ "战魂之翼", "40236" },
|
||||
|
||||
{ "鸿运招财喵碎片", "50001" },
|
||||
{ "极限大黄蜂碎片", "50002" },
|
||||
{ "福禄柴犬碎片", "50003" },
|
||||
{ "哪吒转世碎片", "50004" },
|
||||
{ "五福熊猫碎片", "50005" },
|
||||
{ "九天雷龙碎片", "50006" },
|
||||
|
||||
{ "2千", "70000" },
|
||||
{ "8佰", "70001" },
|
||||
{ "4佰", "70002" },
|
||||
{ "2佰", "70003" },
|
||||
{ "1千", "70004" },
|
||||
{ "2千_2", "70005" },
|
||||
{ "8佰_2", "70006" },
|
||||
{ "4佰_2", "70007" },
|
||||
{ "2佰_2", "70008" },
|
||||
{ "1千_2", "70009" },
|
||||
{ "2千_3", "70010" },
|
||||
{ "8佰_3", "70011" },
|
||||
{ "4佰_3", "70012" },
|
||||
{ "2佰_3", "70013" },
|
||||
{ "1千_3", "70014" },
|
||||
{ "4佰_4", "70015" },
|
||||
|
||||
{ "100万金币", "70001" },
|
||||
{ "500万金币", "70002" },
|
||||
{ "1000万金币", "70003" },
|
||||
{ "2000万金币", "70004" },
|
||||
{ "5000万金币", "70005" },
|
||||
{ "1亿金币", "70006" },
|
||||
|
||||
{ "100钻石", "80001" },
|
||||
{ "500钻石", "80002" },
|
||||
{ "1000钻石", "80003" },
|
||||
{ "2000钻石", "80004" },
|
||||
{ "5000钻石", "80005" },
|
||||
{ "10000钻石", "80006" },
|
||||
};
|
||||
|
||||
if (!Directory.Exists(uploadsPath))
|
||||
{
|
||||
Console.WriteLine($"目录不存在: {uploadsPath}");
|
||||
return;
|
||||
}
|
||||
|
||||
var files = Directory.GetFiles(uploadsPath);
|
||||
var renamed = 0;
|
||||
var skipped = 0;
|
||||
|
||||
foreach (var file in files)
|
||||
{
|
||||
var fileName = Path.GetFileNameWithoutExtension(file);
|
||||
var ext = Path.GetExtension(file);
|
||||
|
||||
if (propMapping.TryGetValue(fileName, out string? newName))
|
||||
{
|
||||
var newPath = Path.Combine(uploadsPath, newName + ext);
|
||||
|
||||
if (File.Exists(newPath) && newPath != file)
|
||||
{
|
||||
Console.WriteLine($"跳过(目标已存在): {fileName} -> {newName}");
|
||||
skipped++;
|
||||
continue;
|
||||
}
|
||||
|
||||
File.Move(file, newPath);
|
||||
Console.WriteLine($"重命名: {fileName} -> {newName}");
|
||||
renamed++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"未找到映射: {fileName}");
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine($"\n完成!成功重命名: {renamed}, 跳过: {skipped}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user