C# session
-
Hello, I am trying to make and c# application using sessions to control the app access, somebady knows how to do it? Regards.
-
Hello, I am trying to make and c# application using sessions to control the app access, somebady knows how to do it? Regards.
Are you sure? Sessions are normally web related, apps are normally PC related. What are you actually trying to do?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
-
Hello, I am trying to make and c# application using sessions to control the app access, somebady knows how to do it? Regards.
-
Are you sure? Sessions are normally web related, apps are normally PC related. What are you actually trying to do?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
I mean Roles, I want that some users can see an especific window and someone diferente can not do it.
-
Hello, I am trying to make and c# application using sessions to control the app access, somebady knows how to do it? Regards.
If it is a web application, take a look at ASP.Net Role provider and Session management. If this is a windows based application, you will have to do it on your own. 1. Set up the Role table in the database or configuration file (not recommended) as desired. 2. Then set up a Rights table. This table should essentially have the list of operations that can be performed. 3. Now, create a Role_Right_Map table. This will be 1 to many relation table between Role and Rights. This will define which Role can do what. 4. Now set up a user table. This table will have your user credentials and other details. 5. Next, make a Role_User_map. This can be a one to may relation based table between user and role. Now, you have your setup ready. Next, when the user logs in, check for the role and corresponding rights. Based on that the available functionality will be decided. As far as session goes, keep track of the login time in some static variable. You will also need one more static variable say activity tracker. If there is no activity done for certain amount of time, log the user out. Possible problems in doing this: 1. If it is a desktop application with database on the client computer, anyone can make changes to the Roles and Rights. Suggested resolution can be to encrypt data in those tables. 2. User can change the system datetime which will negate all the session management rules you put in. Suggested resolution can be like this: When the user logs in, start a timer in a different thread. Now, reset the timer on every activity. If the timer has ticked for your session value (say 10 mins), log out the user.
"Your code will never work, Luc's always will.", Richard MacCutchan[^]
-
Hello, I am trying to make and c# application using sessions to control the app access, somebady knows how to do it? Regards.
Tell me what you want to do exactly? Generally sessions are related ASP.NET Tell me exactly what type of application you wanna create.