Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Easier way to transfer info betwen two seperate programs (exe's NOT forms)

Hello all.
So I've created a program that does things, but I wanted people to be able to access it from other computers. So I created another program that is just a VB.net console app, which hosts an HTML webpage and recieves commands through that. It works fine.

Now my issue comes with getting the server .exe to trigger a method in the other program. I have 2 ways of doing this currently, both which work... But i'm looking for a better way to do this.
The things i've tried (Both work):
1 - Create a file that will just contain simple text commands and check it once in a while for updates. Basically a watch file. It works, but it's slower as it depends on timers and stuff... Also it uses up time and other things just sitting on a hard disk, and may even damage SSD's checking the same file over and over again every second or so.
2 - Use a TCP Client Listener in the main app and a TCP Client in the server to send info from one to the other. This works perfectly so far, but obviously could be stunted by a firewall, and just isn't my favourite way of doing it.

I think i'm missing something really simple? Help me out here if you can. Would be appreciated.

TL;DR: Need a better way of getting one VB.net .exe to trigger a method in another SEPERATE .exe (Not just a different form). [Between two programs]
Whats wrong with just a tcp connection? The firewall will not do anything if both programs use localhost and are on the same computer. The best way imo is to just have a socket connection between the two programs.
The best way is to go the socket route (TCP). No need to over complicate it with a page file.
(Nov 22, 2017 08:16 AM)Ninja Wrote:  Whats wrong with just a tcp connection? The firewall will not do anything if both programs use localhost and are on the same computer. The best way imo is to just have a socket connection between the two programs.

Well in that case then a more preferred way of interprocess communication is by using pipes.

https://docs.microsoft.com/en-us/dotnet/...munication
https://github.com/Washi1337

"I'll tell you this UDP joke, and I don't care if you will get it or not."
Using Data Copy


point:

WM_COPYDATA exists as a convenience; it is not the most efficient way to transfer data across process boundaries. It's not super efficient because sending the message actually makes a copy of the data, so additional memory must be allocated and a block of bytes must be copied. When the target processes the WM_COPYDATA message, it is working with its own copy of the data; changes made to the data are not reflected back to the sending process. You'll want to use the memory-mapped file APIs directly if you're concerned about performance.



worth reading http://www.microsoft.com/msj/archive/S1D4F.aspx
(Nov 24, 2017 04:54 PM)Sn0wX Wrote:  Using Data Copy


point:

WM_COPYDATA exists as a convenience; it is not the most efficient way to transfer data across process boundaries. It's not super efficient because sending the message actually makes a copy of the data, so additional memory must be allocated and a block of bytes must be copied. When the target processes the WM_COPYDATA message, it is working with its own copy of the data; changes made to the data are not reflected back to the sending process. You'll want to use the memory-mapped file APIs directly if you're concerned about performance.



worth reading http://www.microsoft.com/msj/archive/S1D4F.aspx

Old and also requires a message loop which means both programs need to be using Win32 forms; console applications won't work. This also will not work directly over the network.

OP Wrote:but I wanted people to be able to access it from other computers
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer]
(Nov 22, 2017 08:16 AM)Ninja Wrote:  Whats wrong with just a tcp connection? The firewall will not do anything if both programs use localhost and are on the same computer. The best way imo is to kjust have a socket connection between the two programs.



i would have given god status you would have known. News flash TCP is a stream that wants to get data out of its buffer asap. You ever researched the data arrival event???????


you are cluless ninja

god status my ass. i picture you under 16 telling all your friends what an amazing coder you are yeh you dont most any thing.

teach yourself correctly, and i would help. Cary on with this smoke scren making u look an ass
What about doing it in php: the program that sends data, make a POST request to a url with the data needed in parameters, and the other program checks the another url every second or so, to see if there is any new commands, and then executes them.
The api will save the commands in a file or mysql database, so just to make sure that no command is missed or duplicated, when the program looks for commands, the list gets cleared or just marked as done.
(Nov 30, 2017 03:13 PM)Sn0wX Wrote:  i would have given god status you would have known. News flash TCP is a stream that wants to get data out of its buffer asap. You ever researched the data arrival event???????


you are cluless ninja

god status my ass. i picture you under 16 telling all your friends what an amazing coder you are yeh you dont most any thing.

teach yourself correctly, and i would help. Cary on with this smoke scren making u look an ass

I don't understand fully what you just said, but no I am over 18 and I don't brag to anyone about my 'coding skillz'.

And I don't know what you mean with "i would have given god status".
You need to use the Events and mutex APIs to make a synchronized IPC. I work on a similar project atm. Good luck ;)

Read this:
https://msdn.microsoft.com/en-us/library...s.85).aspx
http://derpturkey.com/c-cross-process-synchronization/
(Dec 1, 2017 08:26 AM)Neos07 Wrote:  What about doing it in php: the program that sends data, make a POST request to a url with the data needed in parameters, and the other program checks the another url every second or so, to see if there is any new commands, and then executes them.
The api will save the commands in a file or mysql database, so just to make sure that no command is missed or duplicated, when the program looks for commands, the list gets cleared or just marked as done.

No internet = no transferring.

Op, if you are less proficient you could always store a txt/csv in %temp% on windows with the info you need and try to access it from your other application.

This is probably the simplest answer you will find.
(Nov 30, 2017 03:13 PM)Sn0wX Wrote:  i would have given god status you would have known. News flash TCP is a stream that wants to get data out of its buffer asap. You ever researched the data arrival event???????


you are cluless ninja

god status my ass. i picture you under 16 telling all your friends what an amazing coder you are yeh you dont most any thing.

teach yourself correctly, and i would help. Cary on with this smoke scren making u look an ass

If you had any clue what you were talking about, you would have realized by now that named pipes to a remote/networked PC uses TCP too.
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer]
Quite a bad method but should work.
2 php scripts 1 that sets text in a a text document (let's just says status.txt) to 1 and another that sets it to 0

On program 1 (sender) send a webrequest to the PHP script (sets the value to 1) Then after a certain interval sets back to 0
On program 2 (receiver) read the text file on webserver ever 5ms or whatever, Should probably do this in a background worker to avoid lag (if result = 1 Then (code) Else 'Do Nothing)

Bit impractical but does the job :P
(Dec 1, 2017 11:11 AM)0xDEAD10CC Wrote:  If you had any clue what you were talking about, you would have realized by now that named pipes to a remote/networked PC uses TCP too.

I dont have a clue? I dont hide behind a kids forum scared to post on real forums. I'v been programming since 1993 little boy. Come on it's a joke here.  You get bummed but little coders who have a weeks experience who want to beg for your attention.

Why you not seen me post in the c/c++ section? same reason i stopped posting in the vb section as ident because you're all a joke.


Take prick for example, sorry i mean Ninja. just posts every thread with fuck all examples. Why? Because he is fucking scared of being wrong and shown what a prat he is.


Fuck only reason i pop past here now and then is to laugh at you lot assfucking each other without really understanding whats posted. 


What makes laugh at you muppets i post some helpful info and then post misdirection stuff and your all to fucking retarded to follow.


why did my account get banned? because muppets like lot you could not no 5% of what me/(ident befor banned) knows. Kiddys posting on kiddys forum. Not one of you posts on any adult forums.

to scared to... pricks. Oh wait this post get removed and banned just so you can pretend i never ask you lot step up.


at 14 years old i wrote addons for msn admin client msn chat network, then joined writing viper. Muppets, lets see who flags this first.
(Dec 4, 2017 07:17 PM)Sn0wX Wrote:  I dont have a clue? I dont hide behind a kids forum scared to post on real forums. I'v been programming since 1993 little boy. Come on it's a joke here.  You get bummed but little coders who have a weeks experience who want to beg for your attention.

Why you not seen me post in the c/c++ section? same reason i stopped posting in the vb section as ident because you're all a joke.


Take prick for example, sorry i mean Ninja. just posts every thread with fuck all examples. Why? Because he is fucking scared of being wrong and shown what a prat he is.


Fuck only reason i pop past here now and then is to laugh at you lot assfucking each other without really understanding whats posted. 


What makes laugh at you muppets i post some helpful info and then post misdirection stuff and your all to fucking retarded to follow.


why did my account get banned? because muppets like lot you could not no 5% of what me/(ident befor banned) knows. Kiddys posting on kiddys forum. Not one of you posts on any adult forums.

to scared to... pricks. Oh wait this post get removed and banned just so you can pretend i never ask you lot step up.


at 14 years old i wrote addons for msn admin client msn chat network, then joined writing viper. Muppets, lets see who flags this first.

Okay with the gay jokes, You said you've been coding since 1993? If so what did you code in. But this is coming from a 41  year old virgin, that said he doesn't need to brag about what he coded and how good of a coder he is. etc. etc. But yet here he sits behind a screen talking about how long he been coding etc. etc. Well I've been coding the same to this day I learn new stuff, new methods. But wait guess what I'm a 40 year old man that still gets pussy and doesn't sit behind a screen acting big and bad. You said you didn't want to use TCP but yet Named Pipe uses tcp to communicate back and forth sending and recieving. Before you get you panties in a wod let me. Explain..


Server Starts up..(Localhost/Remotehost)

Client Side(Send to the server(localhost/remotehost) with a name you apoint to it.

Server Side(Check that if that client side name is in the database, due to you know nothing (YOUR TEXT FILE).  Then send okay client your good.

Client Side(Then send back another command.) 

Now to clear this all up It's all TCP but for dummy like yourself that doesn't know how to handle a correct recieve data.

Correct me if I'm wrong please do so. Because If I wrong and I read it wrong I would say "OKAY MY BAD I MISS READ"

NAMED PIPED

Oh and I almost forgot, At 14 I wrote aim chat client  ,yahoo chat client, and a few other it was called cheeta chat program for everyone to use...


Possibly Related Threads...
Thread / Author Replies Views Last Post
by HackersOct 28, 2023 10:25 AM 6 253 Oct 28, 2023 10:25 AM
Last Post: Hackers
by user344335Apr 10, 2023 11:11 AM 0 146 Apr 10, 2023 11:11 AM
Last Post: user344335
[C#] by WeedIsInTheAirSep 24, 2022 04:15 PM 0 176 Sep 24, 2022 04:15 PM
Last Post: WeedIsInTheAir