Passing string to another program instance

K

Kevin Otte

Hi,

I'm currently working on a program that is supposed to allow only one
instance of itself.
How can I transfer the data that is passed to a second instance as a
parameter to the first instance.
One part of my program's functionality is that it parses all links
from a webpage. Well, a script catches them and starts my tool with
the links-string as a parameter. Within my app I want to be able to
select some of those links and store them permanently.
If there is an instance running already, the script starts another
one.
Now the second instance allows me to chose some links.
What I want is to send those links to the first instance so that the
second can terminate.

I hop you understand what I'm trying to do !

Thanks in advance...
 
J

Jon Skeet [C# MVP]

Kevin Otte said:
I'm currently working on a program that is supposed to allow only one
instance of itself.
How can I transfer the data that is passed to a second instance as a
parameter to the first instance.

One way would be to make the first instance that gets in open a port
for listening on, and accepting connections. The second instance would
fail to open the port for listening on, but could then connect to the
port and send the appropriate information down the socket.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top