Click here to Skip to main content
15,888,454 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Create an exe which will produce other exe file Pin
Simon Bang Terkildsen20-Aug-11 15:09
Simon Bang Terkildsen20-Aug-11 15:09 
GeneralRe: Create an exe which will produce other exe file Pin
Musa Biralo20-Aug-11 15:47
Musa Biralo20-Aug-11 15:47 
AnswerRe: Create an exe which will produce other exe file Pin
PIEBALDconsult20-Aug-11 19:59
mvePIEBALDconsult20-Aug-11 19:59 
GeneralRe: Create an exe which will produce other exe file Pin
Musa Biralo21-Aug-11 2:33
Musa Biralo21-Aug-11 2:33 
GeneralRe: Create an exe which will produce other exe file Pin
Not Active21-Aug-11 3:29
mentorNot Active21-Aug-11 3:29 
GeneralRe: Create an exe which will produce other exe file Pin
Dave Kreskowiak22-Aug-11 2:08
mveDave Kreskowiak22-Aug-11 2:08 
AnswerRe: Create an exe which will produce other exe file Pin
Shameel21-Aug-11 3:54
professionalShameel21-Aug-11 3:54 
AnswerRe: Create an exe which will produce other exe file Pin
Alan N21-Aug-11 9:27
Alan N21-Aug-11 9:27 
If you can accept two files to send to the target machine your requirements could be met by

1) An application that allows the user to select files and store them into a resource only assembly (dll)
2) An application to do the checks on the target machine, read the resources and write them out as files.

The resource only assembly is created by invoking the C# compiler, csc.exe, and the following command line will create resourcelib.dll containing two files FileInfo.txt and Help-Aug2011.chm
<br />
csc /out:resourcelib.dll  /target:library /resource:FileInfo.txt /resource:Help-Aug2011.chm<br />

The code needed to read the resources from the assembly and convert them back into files is fairly simple
C#
private void CreateFilesFromResources() {
  Assembly a = Assembly.LoadFile(@"E:\VC\Projects\CodingTests\BinaryResource\bin\Debug\resourcelib.dll");
  foreach (String filename in a.GetManifestResourceNames()) {
    Console.WriteLine("Resource name {0}", filename);
    using (Stream rs = a.GetManifestResourceStream(filename)) {
      using (FileStream fs = File.Create(filename)) {
        Byte[] buff = new Byte[8192];
        Int32 read;
        while ((read = rs.Read(buff, 0, buff.Length)) > 0) {
          fs.Write(buff, 0, read);
        }
      }
    }
  }
}


Hope that helps and has given you a few ideas.

Alan.
QuestionRe: Create an exe which will produce other exe file Pin
Shameel21-Aug-11 23:53
professionalShameel21-Aug-11 23:53 
AnswerRe: Create an exe which will produce other exe file Pin
Alan N22-Aug-11 3:40
Alan N22-Aug-11 3:40 
AnswerRe: Create an exe which will produce other exe file Pin
David Magnotti29-Aug-11 5:22
David Magnotti29-Aug-11 5:22 
QuestionDataTable in .Net Pin
dews turner20-Aug-11 3:12
dews turner20-Aug-11 3:12 
AnswerRe: DataTable in .Net Pin
Simon Bang Terkildsen20-Aug-11 3:50
Simon Bang Terkildsen20-Aug-11 3:50 
AnswerRe: DataTable in .Net Pin
PIEBALDconsult20-Aug-11 6:29
mvePIEBALDconsult20-Aug-11 6:29 
GeneralRe: DataTable in .Net Pin
Simon Bang Terkildsen21-Aug-11 13:07
Simon Bang Terkildsen21-Aug-11 13:07 
GeneralRe: DataTable in .Net Pin
PIEBALDconsult21-Aug-11 14:59
mvePIEBALDconsult21-Aug-11 14:59 
GeneralRe: DataTable in .Net Pin
Bert Mitton3-Sep-11 6:56
professionalBert Mitton3-Sep-11 6:56 
QuestionEvent handling Pin
Pankaj Patel yosa20-Aug-11 2:40
Pankaj Patel yosa20-Aug-11 2:40 
AnswerRe: Event handling Pin
MicroVirus20-Aug-11 3:33
MicroVirus20-Aug-11 3:33 
Questiongadgets for desktop Pin
vannie1819-Aug-11 3:53
vannie1819-Aug-11 3:53 
AnswerRe: gadgets for desktop Pin
DaveAuld20-Aug-11 7:03
professionalDaveAuld20-Aug-11 7:03 
GeneralRe: gadgets for desktop Pin
vannie1820-Aug-11 15:01
vannie1820-Aug-11 15:01 
Questionsearch using textbox and listview in vb.net Pin
atzdgreat19-Aug-11 3:23
atzdgreat19-Aug-11 3:23 
AnswerRe: search using textbox and listview in vb.net Pin
Dave Kreskowiak19-Aug-11 4:53
mveDave Kreskowiak19-Aug-11 4:53 
QuestionString compare oddity [modified] Pin
PIEBALDconsult18-Aug-11 15:21
mvePIEBALDconsult18-Aug-11 15:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.