|
I would probably suggest saving the string in a temporary file and then have App2 to read the string from that file and delete it. You could also take a look at this CP Article: Passing Data between Windows Forms
"If you feel the urge to add complexity, just go home early. You ain't gonna need it." - YAGNI
|
|
|
|
|
No, no - get App1 to create a new SQL DB table (with the timestamp as the table name) and enter it's string. App2 can access the DB and read the value before deleting the table.
Much more multi user friendly and you could put it in the cloud and claim it as an IoT device!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Stop stringing us on!
... such stuff as dreams are made on
|
|
|
|
|
He could also write a Windows service that uses WCF to receive the string, encrypt it, send it to a web site which would store it in a database, and then have his other app periodically poll the web site with a WebClient object that would cause the web site to check the database for new data. Once the data is retrieved, he would then have to call another page on the web site to delete the data that was just retrieved. Then there's all the transaction processing that needs to occur, not to mention the necessity for code that makes sure the string is different from the last time he retrieved it, as well as maintaining a cache of retrieved strings to ensure no duplication has occurred. If he wants it to be configurable, he 'd have a lot more work to do as well. We haven't even GOTTEN to the act of logging everything in the system log yet.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
No Message Queue involved? Sounds like a half baked solution.
|
|
|
|
|
Buy an envelope and stamp. Put the string in the envelope and the stamp on it. Address it to the second app. Post it. Eventually it will arrive.
|
|
|
|
|
I would also suggest placing the envelope in a transporter from StarTrek so that the message can be properly digitized and encoded for transmission to the second app.
if (Object.DividedByZero == true) { Universe.Implode(); }
Meus ratio ex fortis machina. Simplicitatis de formae ac munus. -Foothill, 2016
|
|
|
|
|
It's not done like that anymore you twit! Nowadays, data is passed between applications using emails!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
App1 can encode the string as a series of sounds that are emitted by the pc speaker (preferably using frequencies not human detectable).
Then App2 listens for these frequencies using the microphone and decodes those sounds back into the string.
Then get a job with the NSA.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
Don't listen to these replies, they don't know what they're talking about. If you want two apps to talk to each other, first you gotta take them out to a pub. Apps are usually shy at first, so of course you'll need to buy them a few beers*. Once they're good well and intoxicated, you should tell the first app that the second app thinks its cute. Then tell the second app the first app thinks its cute. Then you can leave, for your work is done, and the transport protocol TCP/WEEPEE version 2.0 will do the rest.
* Should like like this:
Jeremy Falcon
|
|
|
|
|
I think this would work well until the two apps become overly coupled and start spawning too many child processes which become starved for resources.
if (Object.DividedByZero == true) { Universe.Implode(); }
Meus ratio ex fortis machina. Simplicitatis de formae ac munus. -Foothill, 2016
|
|
|
|
|
In which case application B could limit application A's disk access to limit the exposure of copies being created being serialized.
Jeremy Falcon
|
|
|
|
|
Jeez we wouldn't want this guy to create anything Viral, he's just not ready.
|
|
|
|
|
If the children do become serialized, would it be a syndicated reality TV show?
if (Object.DividedByZero == true) { Universe.Implode(); }
Meus ratio ex fortis machina. Simplicitatis de formae ac munus. -Foothill, 2016
|
|
|
|
|
First of all, welcome to Code Project. As you have probably gathered by now from our more robust members, the lounge isn't really the place to ask programming questions; generally you would want to ask a question in a more appropriate forum such as this[^] one.
I have to assume that you don't really need Application 2 open all the time; rather, you have a requirement that Application 1 isn't going to open it with the relevant data. If we accept that as true then this simplifies the problem you have to solve. Basically, what you are looking for is something called Client/Server programming, where you communicate between two separate processes using techniques such as named pipes, sockets, messaging over TCP, and so on. The problem with this type of development is that this really is a complex area - you could use something like Anonymous Pipes[^]; there's a working example in VB.NET there so that should help. Alternatively, you should search Google for examples of Client/Server programming in VB.NET[^]. I hope that this helps to give you some areas to explore.
This space for rent
|
|
|
|
|
I thought the robust members were quite restrained, in days of yore they would have flamed him at the stake.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The day is not over yet!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
The patient told doctors that he has no idea why he started eating knives but that he "developed a taste for metal" and "loved the way blades tasted."
/ravi
|
|
|
|
|
"Malhotra believes the patient has a very rare mental disorder that most likely has not been published in any international medical journal."
I think he means a very rare metal disorder
|
|
|
|
|
Sander Rossel wrote: I think he means a very rare metal disorder
I saw that one coming!
... such stuff as dreams are made on
|
|
|
|
|
I guess he just wanted to live on the edge.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
|
I wonder if they tasted like tang.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Or a variety of mint. Spear, to be specific.
/ravi
|
|
|
|
|
Variety is the slice of life.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|