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 know who executed my application ?

how to know who executed my application ?

Scheduled Pinned Locked Moved C#
tutorialquestion
7 Posts 4 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
    shabya
    wrote on last edited by
    #1

    hello , my application either run automatically on startup or can be manually executed by user. is there a way to know who triggered the application ? i want to add a note about it in a log file my application creates. thanks in advance, avi

    J L D 3 Replies Last reply
    0
    • S shabya

      hello , my application either run automatically on startup or can be manually executed by user. is there a way to know who triggered the application ? i want to add a note about it in a log file my application creates. thanks in advance, avi

      J Offline
      J Offline
      Jimmanuel
      wrote on last edited by
      #2

      Environment.UserName

      1 Reply Last reply
      0
      • S shabya

        hello , my application either run automatically on startup or can be manually executed by user. is there a way to know who triggered the application ? i want to add a note about it in a log file my application creates. thanks in advance, avi

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

        Well I know a dirty workaround: give the auto-startup entry a command line argument and use that. Doesn't give any kind of guarantee, but it will "usually" be accurate and it's easy to implement.

        S 1 Reply Last reply
        0
        • S shabya

          hello , my application either run automatically on startup or can be manually executed by user. is there a way to know who triggered the application ? i want to add a note about it in a log file my application creates. thanks in advance, avi

          D Offline
          D Offline
          Dragonfly_Lee
          wrote on last edited by
          #4

          shabya wrote:

          know who triggered the application ?

          Depends on how you define "who". Computer Name or User Name?

          :) I Love KongFu~

          S 1 Reply Last reply
          0
          • L Lost User

            Well I know a dirty workaround: give the auto-startup entry a command line argument and use that. Doesn't give any kind of guarantee, but it will "usually" be accurate and it's easy to implement.

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

            very good , tnx

            1 Reply Last reply
            0
            • D Dragonfly_Lee

              shabya wrote:

              know who triggered the application ?

              Depends on how you define "who". Computer Name or User Name?

              :) I Love KongFu~

              S Offline
              S Offline
              shabya
              wrote on last edited by
              #6

              hi, i ment by who : the computer itself on startup or manual activation from srart->programs -> ...

              D 1 Reply Last reply
              0
              • S shabya

                hi, i ment by who : the computer itself on startup or manual activation from srart->programs -> ...

                D Offline
                D Offline
                Dragonfly_Lee
                wrote on last edited by
                #7

                shabya wrote:

                the computer itself on startup or manual activation from srart->programs ->

                Well, in this case, Environment.UserName is exactly what you are looking for. Jimmanuel already give you the anwser:)

                :) I Love KongFu~

                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