Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I want to be able to control directly in my program, what other users can do or can not do. I have an ActiveDirectory where the users are saved in 4 different right groups: "User" (Basic function to start the program), "Sales", "Accounting" and "Management" (Administration). The program checks which rights the user has. So right now I have to change the Code and release a new version if I want to change the rights for example "Accounting". But in near future I want to be able to just go to a special window in my program for something like "RightsManagement" and change which group can use which feature. These "RightSettings" should be saved in a global file which will be loaded from every user in our company. That's for the theory...I would like to know if there is a perfect way to do this, I would like to get many different approaches to this problem so I can choose the best for me. Something like a read-only Xml file?
It could be a xml file which is placed in a network drive so the program can access the file from every pc in the company. And that file should be read-only for users so they cant change the settings in that file. Of course through code and the "special window" Admins can set these settings and therefore overwrite the file.
Thank you for your help!
There is no perfect way. You could use a file on a share; a database; AD itself, a web service etc etc. Each has advantages and disadvantages.
You need to ask yourself a set of questions:
Do you have a database server you could use for this, or can you set one up easily and cheaply? How knowledgeable with regard to SQL are you?
What kind of access do you have to AD and how comfortable are you with writing an admin app to manipulate it?
Do you have a suitable file share that everyone, save admins only has read access to and for which admins have write access?
and so forth, depending on which solutions you consider. Only you can ask the full set of questions and answer them and therefore come to a conclusion on which is best for you.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed last month.
Improve this question
My program is a desktop program made by .net7.
The program is running offline and the end-user is a factory, not all the factories have a network or are willing to pay for a network. We can't change this.
The program is used to verify whether the card has been used. The program reads the id (the id is something like Media Access Control Address that is unique) of the card, searches from the database and returns a result.
The data should not be stored in the card self for most people can clone a new card easily (but they can't clone the id).
As we know, we can store the data by database of file by encryption. However, someone can clear all the records by replacing a blank new database/setting or delete it directly.
The only idea for me is to save the data inside the program but not outside it.
Whereas, how can I achieve this? Or is there a better solution? Thank you.
In NTFS (Windows), you can use the alternate stream of the file. Although, technically, the user will still be able to delete it.
See this answer for details on how to do that with .
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm currently working on a windows form application in C# and was wondering how to preserve data between executions? My application starts with a blank form that has a button that dynamically creates user controls, each one just containing a text box (picture a to-do list). The user has the ability to write into these text boxes, as well as dynamically delete them as well.
I've got the application all built and I can create number of objects, but I was wondering how I could save the data between closing and re-opening it. This is in VS 2015.
Much appreciated!
Essentially, you've got two options.
Store to file.
Store to DB.
Depending on your circumstances, privileges etc. you might want to call a web service and feed the state information to it. Then, upon re-launch, you just get read back from it.
Or, if that's a good option, you can simply store a local file with the information and then read from it. The exchangeability of data will suffer and you may face issues with access rights, though.
If the amount information that you need to store is fairly limited, you might simply write a few keys to the registry. The info will still be local and access needs to be granted but except for that, you'd be compartmentilize the data rather well.
In this case I would suggest making a list of your textboxes and then serializing their values and then saving into some format, let's say xml. It is possible to serialize whole list and then load it with simple code.
Edit: Maarten had a good point, I forgot about that you cannot serialize the whole component. I am assuming you are adding textboxes dynamically, so you already have some list/array of values.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
When you send an application to someone, using another computer, besides the application itself, do I have to send the Resources File too? And if I am using a DataBase do I have to send the Database.mdf file too? And what else would you have to send to make sure your application works on another computers?
Sorry if this question is a repeated one, but most of the others just ask for a single item, either the Resources or something else. But I would like to know about everything you have to send.
Thanks a lot !
it depends on your approach. i think you have a software with database and... that you want to sell and make it owrk on other users device. you can make you app make a new database on first start. you can include database files if its local and add to user app directory and... it all depends on you packaging method and tool.
or maybe you want let someone continue the project. so you can give other developer a back up .bak format or export database files from sql server management studio and other developer can attach them to the other machine project
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am currently making a website using ASP.NET MVC5 and I need to keep track of active sessions (or to be more correct, a single value for each users session)
I have looked around and people seem to recommend Session_end() for this but all those recommendations are accompanied by people saying that session_end isn't reliable.
The reason I need to keep track of this is that users receive a unique folder to upload files to. This folder is deleted when a user completes the process but it remains if the website is closed without finishing it.
I currently save the value in a session variable (users should get a folder even when not logged in) and it is lost when the session expires. After the session expired, the folder should be deleted as no user can access it anymore (to save storage space).
I have access to a database, in case that helps for a solution.
It is true that the Session events are unreliable. As a rule of thumb playing with Session is almost never a good idea.
Now if I had to start from scratch with your requirements, I'd go with something that can actively monitor the active user connections on the web application.
Lucky for you there's a tool that does this and much more: SignalR. It's an ASP.NET component that allows to create responsive applications where multiple session can communicate with each other passing through the server. Applications like chats, dashboards and webgames are common applications of this library.
I suggest you to take a look at it and experiment a little, it has all you need to solve your current problem.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Imagine, I create an application ASP.NET MVC for a customer. This application is running an a local server of my customer (I call it customer1). Is there a way to make this application impossible to run foranother customer if customer1 give application to customer2 ?
Thanks,
Why are you bothering and wasting your time with things like this? Make sure you license your code, probably obfuscate it, and sell it to a customer. If he violates the license agreement and gives it to someone else that's his problem. Sue their asses and that's it, end of the story. But remember that no matter what you do they will find a way :-)
So focus on delivering a good product and customers will come by themselves to you asking you to buy it.
You could hardcode in a check for the domain it's running on perhaps. Simple but crude.
I think adding some checking to application start is not a bad idea. checking Computer name and Mac address doesn't seem bad.
1- check in your code for a value placed in a file has an encrypted data.
this file generated on windows root or some root the customer1 not know it.
this file will generate in activating through online connection or by yourself.
in runtime read file and decrypt, you may read values for expired date, some configuration you want.
you may check for as friends said for computer name, ip address anything difference customer1 from customer2
2- also you need to protect dll files from decompilation methods
My Regards
It's a Web Application -- the easiest way is to host the application for your customer, that way they won't be able to get the source for it.
Most applications use business rules, naming conventions, assets, etc. that are unique to their business. Hard code those values into your app so that a shared app just doesn't apply to another customer.
Beyond that, you can look into a real copy-protection package like DeployLX, Infralution or Desaware.
Take a look at Rhino Licensing.
James Gregory wrote a nice post on how to get started with it.
Also the link to a post by Balsamiq in James' article is well worth a read.