Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# session

C# session

Scheduled Pinned Locked Moved C#
csharptutorialquestion
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    adrian salas
    wrote on last edited by
    #1

    Hello, I am trying to make and c# application using sessions to control the app access, somebady knows how to do it? Regards.

    OriginalGriffO L D G 4 Replies Last reply
    0
    • A adrian salas

      Hello, I am trying to make and c# application using sessions to control the app access, somebady knows how to do it? Regards.

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      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 have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      A 1 Reply Last reply
      0
      • A adrian salas

        Hello, I am trying to make and c# application using sessions to control the app access, somebady knows how to do it? Regards.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        What ur trying to do?????

        If you can think then I Can.

        1 Reply Last reply
        0
        • OriginalGriffO OriginalGriff

          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."

          A Offline
          A Offline
          adrian salas
          wrote on last edited by
          #4

          I mean Roles, I want that some users can see an especific window and someone diferente can not do it.

          1 Reply Last reply
          0
          • A adrian salas

            Hello, I am trying to make and c# application using sessions to control the app access, somebady knows how to do it? Regards.

            D Offline
            D Offline
            dan sh
            wrote on last edited by
            #5

            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[^]

            1 Reply Last reply
            0
            • A adrian salas

              Hello, I am trying to make and c# application using sessions to control the app access, somebady knows how to do it? Regards.

              G Offline
              G Offline
              Ganesh Kumar Kaki
              wrote on last edited by
              #6

              Tell me what you want to do exactly? Generally sessions are related ASP.NET Tell me exactly what type of application you wanna create.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups