Licensing vb.Net project

G

Guest

Hi,
I have looked through similar posts and have found Ken Tucker giving the
reply about looking at article http://windowsforms.net/articles/Licensing.aspx

This appears to be for controls and components and though I don't find it
easy to understand it seems like it's appropiate for controls or components,
but I can't seem to find anything that just applies a licence for my entire
application or a licence for using classes, unless I'm misreading something
the article does not apply to this. Please note I am not criticsing Ken
whatsoever, he's being very helpful, just pointing out that I'm finding it
hard to retrieve the kind of information I need either here or anywhere on
the internet and I gather other people are looking for the same kind of
information as well.

In summary what I am looking for is a way of protecting my classes and
protecting my overall project, looking to have a demo with limited
functionality until a full license is purchased, I have never done this
before and I'm struggling to know where to begin, i'm wary of going with any
third party tools as even if they work well, I really don't want to be
spending loads of time trying to figure out how to use them.

Any help would be great particularly if it's specific to vb.net rather than
c#.
Thanks,
Barry.
 
C

CJ Taylor

Just because he doesn't spell it out for your doesn't mean its not possible.

Think about this. What is a control?

A class right?

There is nothing that says you can't use a licensing attribute on a class
itself, regardless of whether or not it inherits from control, that just
happens to be the most common use...

Not only that, but there in big bold letters is "Creating aLicensed Classes"
in which case the class used inherits from IDisposable (interface
inheritance). Not inheriting from userControl at all and using the standard
attributes.

Make sense?

-CJ
 
D

Debbie Carter

No...it still does not make any sense to me. I still don't know if you can
use this licensing thing with a VB.NET project. I could find no help
anywhere on this subject. Searched for hours at MSDN. I must be stupid. I
only see where it is good for controls. What good is it if no one knows how
to use it?
 
G

Guest

Hi CJ,
Firstly thanks for your reply spelling out to me that the info is
there in front of me all the time, I do think though that it is easy to be
shall we say turning your eyes up to heaven and thinking what a moron of my
post when you are someone who already knows the answer, firstly I'm not
familiar with c#, vb.net is my language so I'm trying to make sense of the
article through a language I'm not so familiar with, I did point out that I
could very well be missing something. Anyway I am genuinely apprciative of
your reply but just remember even a keen mind can sometimes find things hard
going and miss the obvious when they are in unfamiliar territory like I was.

Anyway will look through the article some more and try to make sense of it.

Regards,
Barry.
 
M

ML

Yes it can be used to license an app but it is overly complex I believe. I
have looked into this issue of licensing/activation as well and there is
little to no help/examples available.

Here are a few links I have found that might help:
http://www.codeproject.com/win32/simplecopyprotection.asp
http://www.codeproject.com/dotnet/xmldsiglic.asp
http://www.codeproject.com/gen/design/UnconventialWisdom.asp
http://www.codeguru.com/columns/Experts/print.php/c5469/

Also check the http://www.gotdotnet.com/ message boards. There was a few
discussions there as well.
 
C

CJ Taylor

Oh I totally understand that. I've sat here MANY times and looked at an
answer staring me right in the face.

I wasn't trying to beliddle you or anything like that, or make you feel bad,
just trying to walk you through understanding it. Thats the fun of
programming is figuring out how things work under the hood if you will.

So again, making sure I didn't offend you with that, wasn't trying to, just
showing its right there and making sure you understood why it works that
way...

Any more quesitions please feel more than free to ask. =)

Take care,
CJ
 
M

ML

Their activation requires the client to have net access which may not always
be possible.
 
G

Guest

Ok, I have made some progress. So giving this info to help progress this
thing along for those who like me are coming from the vb.net side of things.

I have converted the class code in the article
http://windowsforms.net/articles/Licensing.aspx to vb.net and have used it in
a windows form
here it is

Imports System
Imports System.ComponentModel

Namespace Licensing


<LicenseProviderAttribute(GetType(LicFileLicenseProvider))> _
Public Class LicensedClass
Inherits System.Windows.Forms.Form

Private license As license = Nothing

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
license = LicenseManager.Validate(GetType(LicensedClass), Me)
Console.WriteLine("Hello from the licensed class.")
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
If Not license Is Nothing Then
license.Dispose()
license = Nothing
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
components = New System.ComponentModel.Container()
Me.Text = "Form1"
End Sub

'#End Region

End Class

End Namespace

I am still stuck though as where to go from here. I have tried adding a
licenses.licx file manually but just get the error
D:\projects\licensetest\licenses.licx Could not transform licenses file
'licenses.licx' into a binary resource. (1) : error LC0003 : Unabled to
resolve type 'Licensing.LicensedClass,LicensedClass'

Again I'm sure I'm missing something obvious to those in the know but it's a
frustrating struggle. Anyway it's some progress, maybe somebody else can move
this topic further along.

Regards to all,
Barry.


Imports System
Imports System.ComponentModel

Namespace Licensing


<LicenseProviderAttribute(GetType(LicFileLicenseProvider))> _
Public Class LicensedClass
Inherits System.Windows.Forms.Form

Private license As license = Nothing

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
license = LicenseManager.Validate(GetType(LicensedClass), Me)
Console.WriteLine("Hello from the licensed class.")
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
If Not license Is Nothing Then
license.Dispose()
license = Nothing
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
components = New System.ComponentModel.Container()
Me.Text = "Form1"
End Sub

'#End Region

End Class

End Namespace
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top