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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. how to track an user with in an application

how to track an user with in an application

Scheduled Pinned Locked Moved C#
tutorialquestion
4 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.
  • P Offline
    P Offline
    prasadbuddhika
    wrote on last edited by
    #1

    how can i keep track of the user in the application while he is logged on ,something like session in web appl..

    Z R 2 Replies Last reply
    0
    • P prasadbuddhika

      how can i keep track of the user in the application while he is logged on ,something like session in web appl..

      Z Offline
      Z Offline
      zimbo0101
      wrote on last edited by
      #2

      you can use static variable

      1 Reply Last reply
      0
      • P prasadbuddhika

        how can i keep track of the user in the application while he is logged on ,something like session in web appl..

        R Offline
        R Offline
        rah_sin
        wrote on last edited by
        #3

        u can try following codes u can find process object in System.Diagnostics namespace int pcnt =0; Process curproc = null; Process[] pr = Process.GetProcesses("ur machine name"); foreach(Process pr2 in pr) { if(pr2.ProcessName.Equals("ur application name")) { pcnt=pcnt+1; curproc = pr2; } } if(pcnt>1) { MessageBox.Show("Application already running"); curproc.Kill(); }

        rahul

        P 1 Reply Last reply
        0
        • R rah_sin

          u can try following codes u can find process object in System.Diagnostics namespace int pcnt =0; Process curproc = null; Process[] pr = Process.GetProcesses("ur machine name"); foreach(Process pr2 in pr) { if(pr2.ProcessName.Equals("ur application name")) { pcnt=pcnt+1; curproc = pr2; } } if(pcnt>1) { MessageBox.Show("Application already running"); curproc.Kill(); }

          rahul

          P Offline
          P Offline
          prasadbuddhika
          wrote on last edited by
          #4

          thanks rahul.. could you please explain me what is happening behind these code , it would help me a lot to arrenge this solution as my request.. thanks again...:)

          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