本文介绍了如何使用“FindResource”方法,任何人都可以帮助我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 这是Win32 API方法,我将使用BeginUpdateResource,UpdateResource,EndUpdateResource方法修改DLL文件版本。 它的定义如下: [DllImport( Kernel32.dll,EntryPoint = FindResourceW,SetLastError = true ,CharSet = CharSet.Unicode)] public static extern IntPtr FindResource( IntPtr hModule , string pName, string pType); [DllImport( kernel32.dll,SetLastError = true )] public static extern IntPtr BeginUpdateResource( string pFileName,[MarshalAs(UnmanagedType.Bool) ] bool bDeleteExistingResources); [DllImport( kernel32.dll,SetLastError = true )] public static extern bool UpdateResource( IntPtr hUpdate,字符串 lpType,字符串 lpName, ushort wLanguage, IntPtr lpData, uint cbData); [DllImport( kernel32.dll,SetLastError = true )] public static extern bool EndUpdateResource( IntPtr hUpdate, bool fDiscard); 但是,我不知道如何设置参数lpType ,lpName值 我想达到图片的效果 < img src =http://www.uzzf.com/up/2012-10/201210231672875970.jpgwidth =456height =328/> 解决方案 This is the Win32 API method,I'm going to use "BeginUpdateResource", "UpdateResource", "EndUpdateResource" method to modify DLL file version。It is defined as follows:[DllImport("Kernel32.dll", EntryPoint = "FindResourceW", SetLastError = true, CharSet = CharSet.Unicode)]public static extern IntPtr FindResource(IntPtr hModule, string pName, string pType);[DllImport("kernel32.dll", SetLastError = true)]public static extern IntPtr BeginUpdateResource(string pFileName, [MarshalAs(UnmanagedType.Bool)]bool bDeleteExistingResources);[DllImport("kernel32.dll", SetLastError = true)]public static extern bool UpdateResource(IntPtr hUpdate, string lpType, string lpName, ushort wLanguage, IntPtr lpData, uint cbData);[DllImport("kernel32.dll", SetLastError = true)]public static extern bool EndUpdateResource(IntPtr hUpdate, bool fDiscard);However, I do not know how to set parameters "lpType", "lpName" valuesI want to achieve the effect of the picture<img src="http://www.uzzf.com/up/2012-10/201210231672875970.jpg" width="456" height="328" /> 解决方案 这篇关于如何使用“FindResource”方法,任何人都可以帮助我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-20 13:02