Solved

Component licenzing

Posted on 2004-08-25
17
241 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

717 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