Thanks for your reply...
Is there a way to change assembly attribute during runtime?
In fact what I am thinking of is a way of having a kind of
licence activation for our asembly when distributed.
I was thinking to handle it in the following way:
1- I scann first for the existance of the assembly in the
system
2- then I check th MAC adress of the install system
3- then I combine that mac adress with assembly product
code and may be write thea crypted code somewhere
4- during runtime if that code is valid, I will check one
assembly atrtribute which could be AsssemblyLicCounter
if this lic Counter = 2 then it means that it is able to
use 2 licence, when one is used i decrease that counter by
1, if it reach 0 then he cannot use any extra licence
until we provide hime an extension.
Does it sounds something simple or too crazy or too
complex?
In addition I woul like to get that licence installed in
only one system, in order to avoid copy
thanks for your comments
regards
serge
-----Original Message-----
"serge calderara" <se*************@maillefer.net> wrote
in messagenews:03****************************@phx.gbl... Dear all,
In my assembly info file I have such kind of default
information :
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
Naturally.
Can I add any other type of information I want like as
follow :
<Assembly: AssemblyKeyCode("3215462452158")>
Yes. Look in the documentation on how to create your own
Attribute. It isbasically a class inheriting from Attribute with an
attribute on itselftelling the compiler here you are allowed to put it.
If yes how can I access that key from code?
Using reflection. Get ahold of the Assembly "object"
(yes, it is an object,too) for the assembly, and call the GetCustomAttributes
method on it.
Assembly a; // which you can get from a type when you
have it
AssemblyKeyCodeAttribute [] kcaa =
a.GetCustomAttribuges(typeof(AssemblyKeyCodeAttri bute));
The rest is in the documentation.
Thomas Tomiczek
THONA Software & Consulting Ltd.
(Microsoft MVP C#/.NET)
.