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. remember credentials

remember credentials

Scheduled Pinned Locked Moved C#
question
5 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.
  • L Offline
    L Offline
    laziale
    wrote on last edited by
    #1

    hi guys, I have a question, I want to know how I can store credentials(username, password) once they will be entered and if the user checks the checkbox that he wants to have them stored, so they will not care about typing again when they will visit again the app. It's not a web app, it's a desktop app. Thanks in advance

    C C M P 4 Replies Last reply
    0
    • L laziale

      hi guys, I have a question, I want to know how I can store credentials(username, password) once they will be entered and if the user checks the checkbox that he wants to have them stored, so they will not care about typing again when they will visit again the app. It's not a web app, it's a desktop app. Thanks in advance

      C Offline
      C Offline
      Colwin
      wrote on last edited by
      #2

      You could encrypt the data and then store it in the registry And when the user signs in the next time just pick up the values from there and pass it to the Authentication system you are using hope it helps

      1 Reply Last reply
      0
      • L laziale

        hi guys, I have a question, I want to know how I can store credentials(username, password) once they will be entered and if the user checks the checkbox that he wants to have them stored, so they will not care about typing again when they will visit again the app. It's not a web app, it's a desktop app. Thanks in advance

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        However you like. Registry/XML/app config/database/whatever

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        1 Reply Last reply
        0
        • L laziale

          hi guys, I have a question, I want to know how I can store credentials(username, password) once they will be entered and if the user checks the checkbox that he wants to have them stored, so they will not care about typing again when they will visit again the app. It's not a web app, it's a desktop app. Thanks in advance

          M Offline
          M Offline
          Mbah Dhaim
          wrote on last edited by
          #4

          there are many ways to get your goal, store them to file, registry or configuration file(AppSettings), for example, you just store them to your configuration file, if the setting key is exist and its value not empty then use them as stored credential data, but you must encoded them for security purpose dhaim program is hobby that make some money as side effect :)

          1 Reply Last reply
          0
          • L laziale

            hi guys, I have a question, I want to know how I can store credentials(username, password) once they will be entered and if the user checks the checkbox that he wants to have them stored, so they will not care about typing again when they will visit again the app. It's not a web app, it's a desktop app. Thanks in advance

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            Write a file that contains this information and read it back in later on. This is consistent with the way that websites do it using cookies.

            using (IsolatedStorage storage = IsolatedStorage.GetUserStorForDomain())
            {
            using (IsolatedStorageFileStream fs = new IsolatedStorageFileStream("MySession.xml", FileMode.Create, storage)
            {
            // Write the "cookie"...
            fs.Close();
            }
            }

            To read it back in...

            using (IsolatedStorage storage = IsolatedStorage.GetUserStorForDomain())
            {
            using (IsolatedStorageFileStream fs = new IsolatedStorageFileStream("MySession.xml", FileMode.Open, storage)
            {
            // Read the "cookie"...
            fs.Close();
            }
            }

            The advantage of this method (using IsolatedStorage) is that it can only be read by the user/assembly that created it, and is completely Vista friendly.

            Deja View - the feeling that you've seen this post before.

            My blog | My articles

            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