C# code

Topics: Development
Dec 22, 2013 at 8:21 AM
Are you willing to convert SKGL to C# code instead of vb code ?

You code is working very well as dll, but I want to integrate it in my C# program.

Thanks,
Simon
Coordinator
Dec 27, 2013 at 9:01 PM
Hi Simon,

Thank you for your message! I have been working on this before (see here), however, I never published the code. I really have to make sure that everything will work in C#, and my main problem is to convert the current methods in such a way that will make every calculation the same as in the VB version.

I understand that C# would be a better option, so I will go though the code again this weekend and see what can be done.

Again, thank you for your message!

Sincerely,
Artem
Dec 27, 2013 at 9:07 PM
Hello Artem,

Thanks for the response.

I have integrated the rhino.licensing now into my source, it is working, but way too big for what I want and your solution is exactly what I am looking for, except the vb part and/or a seperate dll.

Thanks again and happy coding! :-)

Best,
Simon

artemlos schreef:

From: artemlos

Hi Simon,

Thank you for your message! I have been working on this before (see here), however, I never published the code. I really have to make sure that everything will work in C#, and my main problem is to convert the current methods in such a way that will make every calculation the same as in the VB version.

I understand that C# would be a better option, so I will go though the code again this weekend and see what can be done.

Again, thank you for your message!

Sincerely,
Artem
Coordinator
Dec 28, 2013 at 5:17 PM
Hi Simon,

Please check out https://skgl.codeplex.com/releases/view/116673

/Artem
Dec 28, 2013 at 6:45 PM
Hello Artem,

I have downloaded the dll and source code. I will look at it tomorrow.

Thanks for the hard work, I will let you know the result asap.

Have a nice weekend!

Best,
Simon
Coordinator
Dec 29, 2013 at 10:18 AM
Hello Simon,

I am looking forward to hear from you about the result.

Happy New Year!

Sincerely,
Artem
Dec 29, 2013 at 10:42 AM
Edited Dec 29, 2013 at 10:46 AM
Hello Artem,

Just a quick reply. I have some problems.

In my project I have a clean compile. As soon as I included your source and change the namespace, I do get an error in my xaml with a ribbonmenu. I have no clue what this is causing, but this is the error:

Error 3 Unknown build error, 'Inheritance security rules violated by type: 'FrameworkWpfMvvm.Helpers.SlimRibbonApplicationMenu'. Derived types must either match the security accessibility of the base type or be less accessible.

Next to that, there are 2 warnings, 1 is not that important, but another might be:

Warning 1 'FrameworkWpfMvvm.Classes.Definitions.Validate.Key' hides inherited member 'FrameworkWpfMvvm.Classes.Definitions.BaseConfiguration.Key'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword.

This warning is pointing to this code:
    /// <summary>
    /// Enter a key here before validating.
    /// </summary>
    public string Key
    {
        //re-defining the Key
        get { return _key; }
        set
        {
            _res = "";
            _key = value;
        }
    }
Any idea ?

Best,
Simon
Coordinator
Dec 29, 2013 at 11:04 AM
Hello Simon,

Some quick questions:
  • did you include the entire source code?
  • did you remove [assembly: AllowPartiallyTrustedCallers()]
  • try to add virtual to the Key property, i.e. public virtual string Key, etc.
  • what environment are you using, i.e. is it an Silverlight app, Windows app WPF, etc?
maybe it will work to remove the key definition from BaseConfiguration

I will look more closely into your reply soon.

/Artem
Dec 29, 2013 at 12:23 PM
Hello Artem,

See my answers below:

did you include the entire source code? Yes
did you remove [assembly: AllowPartiallyTrustedCallers()] I did now and the compile error is gone in my xaml
try to add virtual to the Key property, i.e. public virtual string Key, etc. This didn't help.
what environment are you using, i.e. is it an Silverlight app, Windows app WPF, etc? It is a WPF windows program.

I will remove the key definition from the baseconfiguration and test it again, I will let you know.

Best,
Simon
Dec 29, 2013 at 1:07 PM
Hello Artem,,

Instead of removing the definition, I added 'override' to the second Key definition and with some very basic testing it looks like it is working. I will test it more this upcoming week and I will let you know.

Is it an option to take a look at public/private keys instead of a password ? In the current version the software needs to know the password which was used in the generation.

Are you also planning to convert the Software Protector program to C# ?

Thanks for all the hard work!

Best,
Simon
Coordinator
Dec 31, 2013 at 10:01 PM
Hello Simon,

Thank you for your help!

I have been thinking about public/private keys instead of a password, since, as you mentioned, it's more vulnerable to use symmetric cryptography because the same key is used for both generation and validation. However, my current plan is to use online key validation instead, which I have implemented into Serial Key Manager(http://serialkeymanager.com/).

Here is how it works:
  1. The user stores all generated keys in a database --> prevents duplicates
  2. The password is associated with the product, so every time a user generates/validates a key, it is referred to the product, not the password.
  3. Once a key should be validated through an html form, there is no password that is stored in the form (since that is in the sql database)
  4. Even if the serial key is valid in offline mode, it is not necessarily valid using this online validation procedure. Keys are only valid if they can be found in the database.
Regarding Software Protector conversion to C#, I don't think that would be important because the way users, in my mind, interact with it, is using the UI, and the code there is just to give as good user experience as possible!

Thank you again for your feedback! Please feel free to ask me any other questions! I am looking forward to see how your implementation of SKGL worked!

Happy New Year!

Sincerely,
Artem
Jan 1, 2014 at 6:36 AM
Hello Artem,

First of all, a happy new year to you too.

I have read all the info available on your website and it looks very promising.

However, this is not the way to go for me at this moment. I just want some protection like with your SKGL, if possible with public/private keys instead of a password, so I am going to look into that and present that to my team.

Thanks for all your help, it is much appreciated.

Have a great 2014.

Best,
Simon