Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So the file is in your project and you need it in the same folder(structure) within your folder where your application is.</p> <p>If i'm correct there are two approaches to get this to work:</p> <ol> <li>Mark the file as <em>Content</em>, so that VS will copy it into the folder of your .exe file</li> <li>Add it as resource to your app if in-memory access is sufficent</li> </ol> <h3>For solution 1 (as Content file)</h3> <ul> <li>Mark the file in the Solution Explorer</li> <li>Right click the file and select properties</li> <li>Change the <em>Build Action</em> to <em>Content</em></li> </ul> <p>Now the file is located in <code>Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "license.txt")</code>.</p> <p>Maybe you added a folder in your solution directory and moved the wanted file there. In this case VS will create the whole structure as defined in your solution to lay down your content file. In that case you'll probably need to add the folder information also to the code above.</p> <h3>For solution 2 (as internal resource)</h3> <ul> <li>Add the wanted file (if not already happened) to your project (Project - Add Existing Item)</li> <li>Double click within the Solution Explorer on MyProject - Properties - Resources.resx</li> <li>Click on the little down arrow next to the Add Resource button and select Add Existing File ...</li> <li>Select the file you like again in the dialog</li> </ul> <p>Now the file is added as a internal resource to your project. To access it from code just use <code>Properties.Resources.MyFileName</code>. Depending of the kind of file you'll get here a string (if it is a text only file) or a byte array (if it contains any non text).</p> <p>Also if it is a simple text file you can double click it in your Solution Explorer, edit it and after a rebuilt the new application contains the altered text (very handy if you need some SQL statements or XML files within your app).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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