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. Request a new login

Request a new login

Scheduled Pinned Locked Moved C#
csharp
5 Posts 3 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.
  • Q Offline
    Q Offline
    quilkin
    wrote on last edited by
    #1

    I need to programatically bring up the Windows logon dialog. I don't want to find any usernames or passwords, just force the user to re-enter his credentials - this is to prevent unauthorised users from changing settings in the application if the authorised user has walked away from his desk for a few minutes. There must be a simple c# method that does this!

    D A 3 Replies Last reply
    0
    • Q quilkin

      I need to programatically bring up the Windows logon dialog. I don't want to find any usernames or passwords, just force the user to re-enter his credentials - this is to prevent unauthorised users from changing settings in the application if the authorised user has walked away from his desk for a few minutes. There must be a simple c# method that does this!

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Actually, I think you want to enable the screen saver and make sure that it is asking for a password to unlock. You can't force the Windows Login to show up again just to authenticate. If your application times out and locks itself, you have to put up your own form to capture credentials, then you can pass those to something like Active Directory to authenticate. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      Q 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Actually, I think you want to enable the screen saver and make sure that it is asking for a password to unlock. You can't force the Windows Login to show up again just to authenticate. If your application times out and locks itself, you have to put up your own form to capture credentials, then you can pass those to something like Active Directory to authenticate. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        Q Offline
        Q Offline
        quilkin
        wrote on last edited by
        #3

        Thanks, OK, but is there a way to force the screensaver to come up immediately? I just want to ensure that, when someone presses a 'save' button that changes a database, they immediately get a request for credentials. I don't want to create a new form to capture credentials since there is no way to check the Windows NT password.

        1 Reply Last reply
        0
        • Q quilkin

          I need to programatically bring up the Windows logon dialog. I don't want to find any usernames or passwords, just force the user to re-enter his credentials - this is to prevent unauthorised users from changing settings in the application if the authorised user has walked away from his desk for a few minutes. There must be a simple c# method that does this!

          A Offline
          A Offline
          Anonymous
          wrote on last edited by
          #4

          using System.Diagnostics Process.Start("scrnsave.scr");

          1 Reply Last reply
          0
          • Q quilkin

            I need to programatically bring up the Windows logon dialog. I don't want to find any usernames or passwords, just force the user to re-enter his credentials - this is to prevent unauthorised users from changing settings in the application if the authorised user has walked away from his desk for a few minutes. There must be a simple c# method that does this!

            A Offline
            A Offline
            Anonymous
            wrote on last edited by
            #5

            using System; using System.Runtime.InteropServices; [DllImport("user32.dll")] public static extern void LockWorkStation(); LockWorkStation();

            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