mercredi 20 mai 2015

Get String in Assembly without Load it

I'm loading an Assembly dinamically using:

Assembly _assembly = Assembly.ReflectionOnlyLoadFrom(PathToDllAssembly);

And I can check the Class and/or Methods names.

In order to access Methods i have to Load the assembly:

Assembly _assembly = Assembly.LoadFile(PathToDllAssembly);

But it is possible to get a String value inside the Assembly without actually load it or load it in a ReflectionOnly context?

Edit: Just so you know and maybe you can point me in the right direction, I'm asking that because inside my Assembly I have key String, it is an encrypted string, and I only want to load that assembly if decrypted key is equal to a string.

It is a sort of little protection I'm trying to implement.





Aucun commentaire:

Enregistrer un commentaire