I am going to implement a function that can extract all referenced dll files in an exe.
I'm using "System.Reflection.Assembly" to do it.
But I have no idea how to get file extension.
For example, text.exe contains x.dll, y.dll and z.dll
Above code returns only x, y, z.
Anyone know how to to it?
Thank you all.
System.Reflection.Assembly assemblyFile = System.Reflection.Assembly.LoadFile(exePath);
System.Reflection.AssemblyName[] names = assemblyFile.GetReferencedAssemblies();
foreach (System.Reflection.AssemblyName data in names)
{
listBox2.Items.Add(data.Name);
}