문제

I am currently developing a visual c# application which shall run in background on the first instance "A" it was created. Now, I want that for the other time "B" the same application is run, the arguments in "B" be passed and processed in the existing instance "A". Thus, the "B" will not anymore open a new background application.

I already have searched about making a single instance applications but never have I encountered any solution to this problem of passing the arguments to the running instance.

도움이 되었습니까?

해결책

The only way to solve your problem in my experience is with some form of inter-process communication - Named Pipes, Memory Mapped file, even TCP/WCF are all candidates. So you would use a Mutex to detect if instance A is already running and then connect to it via IPC to pass the parameters.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top