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. C# assign ProcessID

C# assign ProcessID

Scheduled Pinned Locked Moved C#
csharpquestion
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.
  • A Offline
    A Offline
    Alaric_
    wrote on last edited by
    #1

    Does anyone know if there is a way to assign a ProcessID the way you would assign a port for a socket? It would make my life a whole lot simpler.

    "I need build Skynet. Plz send code"

    R M 2 Replies Last reply
    0
    • A Alaric_

      Does anyone know if there is a way to assign a ProcessID the way you would assign a port for a socket? It would make my life a whole lot simpler.

      "I need build Skynet. Plz send code"

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      No.  The process ID is assigned by the OS. I'm curious - why would you want to assign a specific process ID to a process? /ravi

      My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

      A 1 Reply Last reply
      0
      • R Ravi Bhavnani

        No.  The process ID is assigned by the OS. I'm curious - why would you want to assign a specific process ID to a process? /ravi

        My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

        A Offline
        A Offline
        Alaric_
        wrote on last edited by
        #3

        trying to pull an end around a EULA

        "I need build Skynet. Plz send code"

        1 Reply Last reply
        0
        • A Alaric_

          Does anyone know if there is a way to assign a ProcessID the way you would assign a port for a socket? It would make my life a whole lot simpler.

          "I need build Skynet. Plz send code"

          M Offline
          M Offline
          Member 9986689 PandaLion98
          wrote on last edited by
          #4

          I don't think so. You can, however, use Process.Id to identify your runnung app.

          A 1 Reply Last reply
          0
          • M Member 9986689 PandaLion98

            I don't think so. You can, however, use Process.Id to identify your runnung app.

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

            Member 9986689 wrote:

            You can, however, use Process.Id to identify your runnung app.

            The problem here is that the process I was spawning was a daemon, and there is a battery of instances of the daemon all with the same process name...so without some way to either specify the processId of the child or persist its processId before the parent process died, there would be no way to attach to the proper instance (and the instances were not interchangeable) I was able to work around this by adding a Configurator that attached the monitoring process to the daemon as it was being spawned. ...Being able to assign it an arbitrary ProcessID would have made the job easier and reduced the complexity of the implementation (not sure what justified the downvote of my original question)

            "I need build Skynet. Plz send code"

            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