本文整理汇总了C#中System.Resources.ResourceManager.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# ResourceManager.GetType方法的具体用法?C# ResourceManager.GetType怎么用?C# ResourceManager.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Resources.ResourceManager
的用法示例。
在下文中一共展示了ResourceManager.GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
var file = args.Length == 0 ? GetFile() : args[0];
if (string.IsNullOrWhiteSpace(file))
return;
if (!File.Exists(file))
Console.WriteLine($"File \"{file}\" not exists.");
var outPutDirectoty = Path.Combine(Path.GetDirectoryName(file), @"Cracked");
var assembly = Assembly.LoadFrom(file);
rm = new ResourceManager("app", assembly);
var mainAssembly = rm.GetObject(guid);
var filedInfo = rm.GetType().GetField("_resourceSets", BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Instance);
var resourceSets = filedInfo.GetValue(rm) as Dictionary<string, ResourceSet>;
var resourceSet = resourceSets["zh-CN"];
foreach (DictionaryEntry item in resourceSet)
{
var key = item.Key as string;
var value = item.Value as byte[];
if (key == "zip.dll")
continue;
var ms = UnZip(value);
ms.Seek(0L, SeekOrigin.Begin);
if (!Directory.Exists(outPutDirectoty))
Directory.CreateDirectory(outPutDirectoty);
var fileName = (key == guid) ? Path.GetFileName(file) : GetName(key);
FileStream dumpFile = new FileStream(Path.Combine(outPutDirectoty, fileName), FileMode.Create, FileAccess.ReadWrite);
ms.WriteTo(dumpFile);
}
Console.WriteLine("Finished..");
Console.ReadKey();
}