tags:

views:

212

answers:

3

Hi.

i am developing a software (Desktop based app in C#) which will be run in client server environment. Separate license file will be generated for each user and it will be checked on application startup.

there is a requirement that it should also work in network environment. there should be no multiple license files for each computer. so for this purpose how to check that the a single license file is valid for N users.??

A: 

If you mean like bulk license file to be used on x number of machines then you will need some central location, like web service, to track how many machines are using that file.

On start up your application will get machine parameters, license info and contact your service to validate it. If there are already specified number of (unique) machines using that license info it should tell application that license is invalid for more than X number of machines.

It is easier said than done! You better look for some third party licensing component vendors.

TheVillageIdiot
i like your solution. yes there is a server which will track how many clients are connected. i can check at that time. third party licensing components are costly.:)
Mohsan
A: 

Also you could send UDP multicast over the network. And count number of working clients. (ReSharper use this trick) here is sample code

_receiveClient = new UdpClient();

Socket s = _receiveClient.Client;

const int optionValue = 1;
s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, optionValue);

s.ReceiveBufferSize = 256*1024;
s.ReceiveTimeout = 2000;
s.Bind(new IPEndPoint(IPAddress.Any, _uri.Port));

_receiveClient.JoinMulticastGroup(_groupAddress, 2);
Sergey Mirvoda
+3  A: 

This is one of those small projects that look easy at first but tend to become extremely complex depending on ambition level.

There are some factors to consider before doing such a solution

one of the biggest topics is security, how well do you want to protect your license handling encrypted files/database/communication? should the license handling allow for individual features to be turned on/off for individual clients? do you want to store the license information in the database or should you just generate valid keys using some algorithm and then check the key when user connects? what approach to use when the license server is offline, nerve the client with popups? don't start? allow for it to run normally and only check license once a week? and so on.

One approache I've seen which seem to work pretty well was to have license files, these are encrypted but contain one or more mac addresses of the client. They are not sent to each client, instead they are entered into the server (some window service,webservice etc). When the client starts up it connects to this central license server. The mac address of the client is compared to registered clients. If the license key is invalid, every X minutes a popup is shown on the screen saying that the client is running on a temp. license and that he please should get a permanent license. If no permanent license has been obtained withinr 30 days the client will not startup. (This method can be used for sending out demo clients as well)

Anders K.
Is there any other thing beside MAC, I can use to surely identify machine - like CPU id ?
m1k4