Solved

Component licenzing

Posted on 2004-08-25
17
238 Views
Last Modified: 2013-11-25

Is there any way to implement licenzing for COM+ *.dll components , developed in Visual basic?

Any suggestions appreciated.
0
Comment
Question by:andris333
  • 8
  • 5
  • 4
17 Comments
 
LVL 14

Expert Comment

by:Matti
ID: 11895657
My is a little oldfashion way to use .lic-file control don't go to design mode whit out the lic-file found from controls path. Redistribution whit exe app don't require this lic-file.

Private Sub UserControl_InitProperties()
On Error Resume Next
Dim Sline$, i&
Open App.Path + "\MyCtrl.lic" For Input As #1
Line Input #1, Sline
If Sline <> "123asd897124adhshgasdlkja98546pwer842571239081238099fsdkl009asd43289" Then
MsgBox "Sorry! Can't found the licence file to use this control in desing environment!"
Stop
End If
Close #1
End Sub
0
 
LVL 2

Expert Comment

by:x50Fade
ID: 11899999
Do you want to prevent some other developer from stealing your functionality in your dll, or do you want to prevent applications from accessing it if they are not licensed?
0
 

Author Comment

by:andris333
ID: 11919763

Actually I want to both. But the most important for me is to prevent applications from accessing it if they are not licensed. My application in a specific VB COM+ project running form asp.

0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 2

Expert Comment

by:x50Fade
ID: 11919840
What I do is to just create an extra Variable in each function declaration...sort of acting like a password...

So in order to call the function, you have to pass it the right "password"

Hope this helps
0
 

Author Comment

by:andris333
ID: 11919910

You mean different password in EACH function?

Is it right in this sample code:

Function aaa(byVal simpleVal, byVal Password)

if Password<>"FFF" Then Exit Function

' ... code here

End Function
0
 
LVL 2

Expert Comment

by:x50Fade
ID: 11919982
Yup, that's what I do....works ok but I also wrote my own DLL to manage my licensing of my apps....I only use the above mentioned method to protect my dll so that no-one else can use it to protect their software if they don't have the propper "password"
0
 

Author Comment

by:andris333
ID: 11920067

Ok, but where do you store the password? If somebody could get it, this dll could be potentially installed and used somewhere else?
0
 
LVL 2

Expert Comment

by:x50Fade
ID: 11920138
The password is stored in the DLL itself.....Someone who knows it WILL be able use the DLL, hence I'm the only one with the password...SO i'm the only one using it...

P.S. What if someone steels (get's ahold) of your bank pin number??? Same thing
0
 

Author Comment

by:andris333
ID: 11920206

Well, I still don't get it.
For example, I have a class class1 and  a function function 1.

Function function1(byVal simpleVal, byVal Password)

if Password<>"FFF" Then Exit Function

' ... code here

End Function

Then I call this function from asp like:

aaa = somecreatedobject.function1("simpletext", "FFF")

So someone who sees asp file source could steal my pwd. Am I right?







0
 
LVL 2

Expert Comment

by:x50Fade
ID: 11920354
Yes you are right...I apologise for not reading your second post more carefully....

With ASP this might pose a problem, cause it does not get compiled...

I do normal EXE apps so mine gets compiled and no-one can see my source
0
 
LVL 14

Accepted Solution

by:
Matti earned 300 total points
ID: 11930418
Just thinking that adding files or registry entrys don't be enough to protect aginst those who have free access to server.

Only is use connection to own server and send IP or domain name after resolveing it on " component side and  prevent or allow component to run.

So need a server and there an app to listen a port and look against IP or domain database.
And in component code to resolve IP or domain and make a connection to server
There are a lots of VB sample codes these both apps.

This would be sure way to get info from all copies running, it will slow of cause.

Matti
0
 

Author Comment

by:andris333
ID: 11989208

So I need to refer to our server 80 port to check if a license is aviable for a computer that has application installed? And what if domain name changes?

Btw: Could you post some links how it could be done?
0
 
LVL 14

Expert Comment

by:Matti
ID: 11989754
Not port 80, select another.

To start here is some:

Server side:
a sample how to use Wininet API:
http://www.freevbcode.com/ShowCode.Asp?ID=856

Get IP
http://vbnet.mvps.org/code/network/ipaddress.htm

Get domain name:
http://www.freevbcode.com/ShowCode.Asp?ID=393

Convert an IP address to a Long Integer for API Calls
http://www.freevbcode.com/ShowCode.Asp?ID=4189

Client, dependence the conditions but an app listening port and the database or list of valid users.

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20285573.html?query=Listen+port&topics=93

Matti
0
 

Author Comment

by:andris333
ID: 11989867

But if a client has a firewall, it would be possible to detect that I am sending some info to web if I won't use 80 port?
0
 
LVL 14

Expert Comment

by:Matti
ID: 11990087
In this case your app would be on server and you can document that port you have there,  the firewall problem is on the other side but if it's on your control the use 80.

Matti
0
 

Author Comment

by:andris333
ID: 11995242

Ok,

So I need a VB license control application on server that would listen to a specific port and a special functions in software that would call my server port. Every time an application would start on different computer, it would send some info to a server where vb license control application runs. Vb license control application would that check a license key and make an answer to a call. Am I right?
0
 

Author Comment

by:andris333
ID: 12084219

Hi again,

I solved my problem already. Thanx for your help Matti.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SAPE.heur.AE935 Visual Studio 3 48
passing a value with stream reader AFTER a ";" 3 70
Spell Check in VB6 13 115
Macro Excel - Multiple If conditions 2 73
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question