Including an exe file into the application and then extracting and running it in run-time ?
Hi, I've been developing a .NET application for quite some months with the help of a friend, but now I need to bind an exe file into it and in run-time extract and run it. My friend (who develops using PureBASIC but has moved to C#) gave me some code he uses for his authentication system and I've adapted it to my needs (in PB), but since he can't help me further I've come to see if some of you can help me with this.
My adapted authentication system is a PB-made exe file because I can't find a way to generate a MachineID (using stuff like CPU/Motherboard ID, HD serials, etc. and then MD5-hashed, for my program) and do HTTP POST requests, but I can do it in PB so I have the EXE which authenticates. The actual problem is: How can I add that .exe file inside my .NET app, and extract then run it in run-time? I've searched a lot through the C# help system and I've found stuff about System.IO.FileStream, "serializers" and complicated stuff like that. I also stumbled upon some VB 2005 code I tried to convert with no avail (I lost the link though :( ) and I work better with a small code example rather than with a long theory document.
Another alternative would be then, how would I generate a MachineID with hardware serials/models/etc. (or at least how to get those!) and how to make HTTP POST requests (and retrieve the results), but I guess that's more complicated than just binding the .exe, extracting and running in run-time, isn't it?
Any help would begreatly appreciated :).
Ah, those links and your help were really great! thanks a lot!!!!!

My solution here had some trial-and-error though. Maybe this could help other people:
In my project settings, and such, my program was named Chatting.NET . Somehow, "Chatting.NET.Test.exe" as theResource didn't work, neither removing the .NET and leaving it as ChattingNET.Test.exe, so what I did was this: Since my namespace was Chatting instead of the Assembly Name and such (which was Chatting.NET), I used "Chatting.Test.exe" and it worked! here's some code sample to understand it better 
namespace Chatting{static class Program{
[STAThread]
static void Main()
{
Stream theResource = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Chatting.Test.exe");
Also:
System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(Application.ProductName + "." + "Test.exe");
Would have done it too. Thanks for the help! 