Solved

Component licenzing

Posted on 2004-08-25
17
237 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
Comment Utility
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
Comment Utility
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
Comment Utility

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
 
LVL 2

Expert Comment

by:x50Fade
Comment Utility
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
Comment Utility

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
Comment Utility
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
Comment Utility

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
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:andris333
Comment Utility

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
Comment Utility
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
Comment Utility
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
Comment Utility

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
Comment Utility
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
Comment Utility

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
Comment Utility
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
Comment Utility

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
Comment Utility

Hi again,

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

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now