0

I have been developing a management system in C#.Net winforms. I need to use a centralized database through LAN.

Scenario:

I have to apply some checks that if someone wants to copy my software to some other computer, he would not be able to run it on the other computer, since I would give my clients software, they would run it and everything will be configured through wizard.

Earlier Workaround:

Earlier, I was storing my MAC address of local machine in database, but problem was that When i needed to connnect more than one computer to the same database, each computer was having it's own MAC address.

My opinion:

So, I thought that in the first time run of software I should save some unique thing like net_address of installed SQL Server in database so that any client can connect to database and database should have get net_address of SQL Server. It also caused a problem that when I did reset my wifi the net_address changed. So SQL was not recognizing lastly saved net_address address since It was continously changing.

Problem:

Now I need some idea how to work over it? I have to get some unique thing that can be used to check in future if the MAC address of the machine is same as the one for which it had been installed on! Many ideas are welcomed.

CodeGenius
  • 514
  • 1
  • 6
  • 21
  • maybe use local machine's hard drive serial #. should be unique enough? – urlreader Dec 10 '16 at 18:12
  • @urlreader But the problem is how can i access the hardware in sql? If I can find MAC address of the machine on which SQL server is installed that would also be enough – CodeGenius Dec 10 '16 at 18:16
  • 1
    Duplicate of http://stackoverflow.com/q/3398428/73226 – Martin Smith Dec 10 '16 at 18:31
  • Probably your clients won't be happy if the software fails to work after they upgrade the network card. – Martin Smith Dec 10 '16 at 18:33
  • @MartinSmith yes that is why I need some hardware info in SQL, it can be Computer's MAC address on which SQL Server has been installed. Is there any workaround? – CodeGenius Dec 10 '16 at 18:35

2 Answers2

0

There's another question on SO with an answer from Martin Smith (as linked to in his comment) that would seem to to what you need but I would advise against going down this route of software protection.

If you search SO for other anti-piracy questions you will find almost all the answers advising not to try; questions such as How to protect my application against piracy with an answer that starts with:

As any license enforcement solution can be cracked with a bit of effort, I suggest you don't try...

Or, Prevent piracy of desktop application which doesnt need Internet connection? with the accepted answer stating:

The only standalone thing I've seen that is semi-effective is hardware keys that come with the boxed software. They used to attach to a parallel port or a serial port and get checked when you started the program.

AutoCad and similar programs used to do this, but it is a BIG PAIN for your customers.

Over on the Software Engineering site there's another interesting discussion.

There are copy protection systems out there which will prevent the majority of people copying your software but think about it, if the likes of Microsoft can't eradicate piracy of their software with all the gazillions of dollars they have to throw at it, do you you think a simple MAC address check is going to?

I appreciate you work hard to write software and want to make money from it but unless you are a security/encryption expert either buy some licensing code from somewhere or don't bother.

I realise you are trying to prevent "piracy" within an organisation, but the same issues will apply. It's better to support and trust your customer to do the right thing, then spend all the time you have saved writing more great software rather than wasting it on ineffective copy protection.

Community
  • 1
  • 1
Tony
  • 9,672
  • 3
  • 47
  • 75
-1

I don't believe it's possible to get the server mac address. See this connect article. You can get the client mac address with this command though select net_address from sysprocesses where spid = @@SPID

Ben Campbell
  • 368
  • 3
  • 8
  • i tried this thing, but net_address keeps on changing. I need something in SQL that should be unique for the computer. – CodeGenius Dec 10 '16 at 18:27
  • Net_address if for the client not the server. It should be the same on any server for a given client though. I had another thought `xp_regread` may do the trick. – Ben Campbell Dec 10 '16 at 18:29