Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

I have developed a MVC project & I have to host the project on Client's Intranet and there's No. of restriction for users and etc. But I want to block the client to copy project and use it on another machine/server. It should only be hosted only at 1 place.

Is there any way to do so?

Thanks in advance.
Regards

What I have tried:

I tried with Unique key storing key in some local file or in database but that can be copied away with project & database.
Posted
Updated 6-Feb-18 2:38am

1 solution

Hi Chirag,

One solution(using a Unique Key similar to your previous solution), is to create a console/desktop application that unlocks your installed MVC application.
Here is how it works :
1/Generate a Serial specific to PC/Server using the ManagementClass
public static String GetProcessorId()
  {

      ManagementClass mc = new ManagementClass("win32_processor");
      ManagementObjectCollection moc = mc.GetInstances();
      String Id = String.Empty;
      foreach (ManagementObject mo in moc)
      {

          Id = mo.Properties["processorID"].Value.ToString();
          break;
      }
      return Id;

  }

Now, this just get the processor_ID, you need somthing more viable.
You can get Manufacturer, Processor ID,Adress Mac ...
More informations about
Get Computer Hardware Information using C#[^]
After you create your own Serial generator.
2/You run your SerialGen (your console/desktop app) in Target Machine, and save it in DB, file...

3/In your MVC Application_Start(), you generate the Serial and compare it to the one saved using your SerialGen.

*ofc, the serial will not work in any other machine since its related to the one it was genreated on.

Thats it.

This solution only works if you have access to the Target Machine.
Few years earlier, I used somthing similar but instead of running SerialGen in Target Machine, i send data using a service, and check if that Machine have a licence.

Hope it helps.

PS: You need to add a reference to System.Management.
Right click on References in solution explorer -> Add Reference.
On the .NET tab select System.Management and click OK.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900