C# : how to - single instance application that accepts new parameters?

后端 未结 4 1925
离开以前
离开以前 2020-12-01 11:26

I\'m creating a (C#) program that downloads binaries using NZB files, there may only be one instance of my application running at any time.

So when a user doubleclic

相关标签:
4条回答
  • 2020-12-01 11:30

    Look at the InitialInstanceActivator at the Genghis project

    0 讨论(0)
  • 2020-12-01 11:36

    Why not have one program that adds the file to a queue, and then kicks off the downloading program if it is not already running. That downloading program watches the queue, which is just a file that you append download file names to.

    0 讨论(0)
  • 2020-12-01 11:38

    Use an IPC (inter process communication) mechanism such as .net remoting

    0 讨论(0)
  • 2020-12-01 11:42

    Try this: Your main program creates a named pipe or other interprocess communication facility and listens on it. You create a separate small program that, when run with an NZB file as a parameter, opens the pipe, feeds the file info into it, and exits. Your main program then processes the new file and downloads it.

    0 讨论(0)
提交回复
热议问题