[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 450
  • Last Modified:

Binding files in C#

Hey,

Is it possible to bind two files into one file ? If its possible how ?

E.g if i got two files a.exe and b.exe then i want to bind them into c.exe so when i execute c.exe it'll automatically execute a.exe and b.exe

Thanks
0
ravedome
Asked:
ravedome
  • 2
2 Solutions
 
DhaestCommented:
That's not possible.
The only thing that you can do is to crate a .bat or .cmd file where you add a reference to both files and execute it.
The file would be something like this:
start a.exe
start b.exe
0
 
ravedomeAuthor Commented:
It can be done e.g http://www.safe-install.com/programs/file-joiner.html and i've seen exemples doing it in VB, just curious whether it's possible to do in C#
0
 
DhaestCommented:
I guess that you can compare this program with a zip-program. Add it to one package and built an exe from it. When clicking the exe, it will extract the exe and run it. Afterward the second one.
I haven't seen it before in coding. (I don't see any reason why you should create something like that, because it can get a very huge file, which will need a lot of memory)
0
 
Anurag ThakurCommented:
filejoiner is a tool for packing different kind of files into a single file so that they can be transported together in a single file
but what you are are asking is that bundline 2 executables - generating a single exe and then when you execute that single exe you get the functionality of both the bounded executables

either you can get the sequential exe by using the BAT file as suggested by Dhaest or you can use reflection to load both the assemblies and then execute the required methods through reflection based on your requirements. The following link might help towards that
http://gsraj.tripod.com/dotnet/reflection.html
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now