Click here to Skip to main content
15,911,142 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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:
C#
[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” values

I want to achieve the effect of the picture

<img src="http://www.uzzf.com/up/2012-10/201210231672875970.jpg" width="456" height="328" />
Posted
Comments
Richard MacCutchan 30-Apr-15 4:19am    
It's much easier to update the source code. Using these functions can easily corrupt the DLL so it becomes unusable.
fengyuchun88 30-Apr-15 4:42am    
So tell me why the picture of the program can be implemented?
http://www.uzzf.com/up/2012-10/201210231672875970.jpg

Do not tell me impossible,If this is not why the program which inside the picture can be achieved?

Look it
 
Share this answer
 
v3
Comments
Richard MacCutchan 30-Apr-15 4:50am    
I did not say it is impossible, I said it can corrupt the library. And if this is your library then you should update the source, which is safer. And if this is not your library then what you are doing is probably illegal.
fengyuchun88 30-Apr-15 5:19am    
I'm sorry, I apologize to you, I should not get angry, I just feel very anxious, I can tell you, this is my library, it's not illegal, I just want to change my own translation DLL version, but not find a good way to achieve it, I am very sad.I hope you can help me. Because I do not want to modify the project assemblyinfo.cs file ,Because a solution, there are too many projects,So, I can not modify each projects assemblyinfo.cs file, that's so tired
This is just a follow on from How to modify the assembly version?[^] where you were already warned not to do this.
 
Share this answer
 
HI!Richard MacCutchan
I'm sorry, I apologize to you, I should not get angry, I just feel very anxious, I can tell you, this is my library, it's not illegal, I just want to change my own translation DLL version, but not find a good way to achieve it, I am very sad.I hope you can help me.
Because I do not want to modify the project assemblyinfo.cs file ,Because a solution, there are too many projects,So, I can not modify each projects assemblyinfo.cs file, that's so tired
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900