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. How to log-on a windows xp user

How to log-on a windows xp user

Scheduled Pinned Locked Moved C#
csharptutorialquestion
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.
  • S Offline
    S Offline
    SummerBulb
    wrote on last edited by
    #1

    Hi there. I'm trying to write a c# code that will automaticaly initiate a user login, if the user is logged off for a given period of time. I've tried using the ADVAPI32.DLL's function LogonUser, but apparently that is used for impresonation (am i wrong?). So, how is that done? In addition, i failed to find a way to check if a specific user is logged on or not. Any idea? Thanks, SummerBulb

    M C S 3 Replies Last reply
    0
    • S SummerBulb

      Hi there. I'm trying to write a c# code that will automaticaly initiate a user login, if the user is logged off for a given period of time. I've tried using the ADVAPI32.DLL's function LogonUser, but apparently that is used for impresonation (am i wrong?). So, how is that done? In addition, i failed to find a way to check if a specific user is logged on or not. Any idea? Thanks, SummerBulb

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

      Although I believe you can write C# code in a service that will run when a user is logged off, I doubt you can log on through such code.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      1 Reply Last reply
      0
      • S SummerBulb

        Hi there. I'm trying to write a c# code that will automaticaly initiate a user login, if the user is logged off for a given period of time. I've tried using the ADVAPI32.DLL's function LogonUser, but apparently that is used for impresonation (am i wrong?). So, how is that done? In addition, i failed to find a way to check if a specific user is logged on or not. Any idea? Thanks, SummerBulb

        M Offline
        M Offline
        musefan
        wrote on last edited by
        #3

        How are you planning to run your code while there is no user logged in? Do you not think this defeats the purpose of having a login?

        Life goes very fast. Tomorrow, today is already yesterday.

        S 1 Reply Last reply
        0
        • M musefan

          How are you planning to run your code while there is no user logged in? Do you not think this defeats the purpose of having a login?

          Life goes very fast. Tomorrow, today is already yesterday.

          S Offline
          S Offline
          SummerBulb
          wrote on last edited by
          #4

          The code will run as a service. I've already managed to run a c# application as a service. That's the easy part. Although, is should be takan into consideration that in order to run a c# app in th logon window, is has to run under SYSTEM. That might make things more complicated.

          1 Reply Last reply
          0
          • S SummerBulb

            Hi there. I'm trying to write a c# code that will automaticaly initiate a user login, if the user is logged off for a given period of time. I've tried using the ADVAPI32.DLL's function LogonUser, but apparently that is used for impresonation (am i wrong?). So, how is that done? In addition, i failed to find a way to check if a specific user is logged on or not. Any idea? Thanks, SummerBulb

            S Offline
            S Offline
            SummerBulb
            wrote on last edited by
            #5

            Solution found. Not by using an app, but by regidtry configuration. see: http://support.microsoft.com/kb/315231[^] Thanks.

            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