Directly Passing Variables

  • Thread starter Thread starter Miro
  • Start date Start date
M

Miro

Hi, ( using vb.net 2003 )

Im not quite sure what to look for in the help / online for this.

Example: You have 2 seperate .exe files running ( both written in vb.net )

Is there a way to make 1 exe "listen" on a port or something ( other than
a text file ) so the 2nd
exe can transfer a variable to it or an array ?

Currently my solution is that the 1 exe writes a text file and the other
goes and reads it.
I was wondering if I can create a direct approach somehow. I do not want to
use a db file. I barely
had the rights to a computer to write the txt file.

Thanks

Miro
 
I'm still a little new to all of this coding stuff but could you not just
copy your info into the clipboard and then paste it into the new .exe? Just
a thought.
 
Im new to vb.net as well.

The only thing i would be scared of using the clipboard for is that if the
user has something in the clipboard from
another application, i would be wiping that out. So i would have to start
managing the clipboard - reading / storing/ and
re-writing the clipboard to the old data once i was done.
Still simpler ( for me ) then to use a text file still and do it in a timer
or filesystemwatcher on that file.

I never thought of the clipboard though... I like the answer, but looking
for a way to set an app to constantly listen
to a "port" or something so when the other app loads...itl just shoot off
some data to a "port" ( or something ) and the
other app instantly gets it.

Miro
 
Miro said:
Hi, ( using vb.net 2003 )

Im not quite sure what to look for in the help / online for this.

Example: You have 2 seperate .exe files running ( both written in vb.net )

Is there a way to make 1 exe "listen" on a port or something ( other than
a text file ) so the 2nd
exe can transfer a variable to it or an array ?

Currently my solution is that the 1 exe writes a text file and the other
goes and reads it.
I was wondering if I can create a direct approach somehow. I do not want to
use a db file. I barely
had the rights to a computer to write the txt file.

Thanks

Miro

Perhaps you could create a pipe or message queue?

I have no idea how to use these, but i see message queues in Server
Explorer (in 2005 at least).

B.
 
I have no idea those are, and they are present in vb.net 2003

I will read up on those and see how I can use those and see if it works.

If it does work, or I do run into a different solution I will post it here.

I have also tried and it does work - to write to the Log File. This works
fine, and i read the log file
for the data i needed and continued. However I dropped this solution
originally because not all machines
allow you to write to the registry ( which the log file uses ) - I never ran
into that situation, but if you do look
into your registery - that is where it stores the Log and the Source. Its
really also a pain kinda to get working.
Somehow windows stores the Log even after you delete it from registery and
stuff.

But that was also another solution I used and dropped.

Miro
 
Miro,

I think the "easiest" way to do it, like you said originally is to open a
port and send from one app and listen from the other!
Just use TCP/IP or UDP to open a port - it works on the local machine, not
just across cables.
Solution worked well for me anyway!

HTH

___________________________________
The Grim Reaper
 
Can you point me in the right direction of where I can read on a
simple prog that opens listens and closes a tcp/ip / or udp port.
/ or sends.

I am a bit new to vb and not sure exactly the terminology to search for.
Im not asking for the code... just 'what am i looking for in vb / or the web
for help'

Thanks

Miro
 
Back
Top