1

In order to avoid duplicate entries from same machine that access the WebApp, I am currently looking for the least complex unique identifier as the default values in my MVC models (besides ID).

I am thinking on using MAC (assume it is on same network) as default values. But I don't know how to set it up.

OreoFanatics
  • 818
  • 4
  • 15
  • 32
  • Do you want to use [dynamic IP restrictions](https://www.iis.net/downloads/microsoft/dynamic-ip-restrictions) or your task is user identification? – Alexander May 09 '17 at 09:50
  • 1
    Maybe Guid will work for you. It is Unique across machines too – Gururaj May 09 '17 at 09:52
  • The question is not specific enough. Are you saying you only want to allow one concurrent session from one computer? – zaitsman May 09 '17 at 10:00
  • Hi guys, my purpose is just to avoid duplicate entries from same machine into the database. If Guid can do the work, then it is great! – OreoFanatics May 09 '17 at 10:02
  • Please specify what you really mean by "duplicate"? Are you afraid of duplicate id if you use int values? – Sir Rufo May 09 '17 at 10:05
  • @SirRufo I just want to prevent same machine being added into the database. – OreoFanatics May 11 '17 at 07:38
  • Possible duplicate of [How to uniquely identify the client machine in an ASP.NET application?](http://stackoverflow.com/questions/4609316/how-to-uniquely-identify-the-client-machine-in-an-asp-net-application) – Sir Rufo May 11 '17 at 07:49

1 Answers1

0

You should use a user control to solve this. The problem is it the user or machine? Machine you already said, with MAC address you can do the trick. But your question is a little open, I'm in doubt. You can just check on database for any entries and just replace with the update data. If the acces is really a problem, you can compare and block.

Hope it helps. It's just an overview.

mmelotti
  • 336
  • 3
  • 11
  • If I want to use MAC, any solution on how to add that as a value into a field models? – OreoFanatics May 11 '17 at 07:39
  • I don't know if iI get the question right, but I think you just have to save as a String like and compare every time that a new connection is made, so, do your code and make whatever you want to implement; :) – mmelotti May 11 '17 at 12:47