Note that there are some explanatory texts on larger screens.

plurals
  1. POLet VB Form prepare working environment in chosen directory
    text
    copied!<p>I am working on a GUI for a simulation program. The simulation program is a single .exe which is driven by an input file (<code>File.inp</code> placed in the same directory). The <code>Original.inp</code> file functions as a template from which the form reads all the values into an array. Then it changes these values reflecting the changes done by the user in the form. After that it writes all the new values to <code>File.inp</code>. By pushing the "Run" button the <code>Simulation.exe</code> file is executed. The folder structure looks like this:</p> <pre><code>root | |---input | | | |--Original.inp | |---GUI.exe |---Simulation.exe |---File.inp </code></pre> <p>Ideally I would supply only the GUI, the user would select the working directory and then the GUI.exe would create an input folder and extract the <code>Original.inp</code> and <code>Simulation.exe</code> in the appropriate locations. So far I have only managed to include <code>Original.inp</code> and <code>Simulation.exe</code> as "EmbeddedResources" in my VB project and I have let my code create an input folder in the working directory chosen by the user.</p> <p>Can someone please explain to me how I can extract the .inp and .exe file into the correct directories? I've searched on google, tried <code>File.WriteAllBytes</code> and <code>Filestream.WriteByte</code> but did not get the desired results.</p> <p>The problem with <code>File.WriteAllBytes</code> was that I could not point to the embedded resource ("Simulation.exe is not a member of Resources" and with <code>Filestream.WriteByte</code> I got a 0 kb file.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload