How Can i Add a Specific File in My OS #2785
-
i want to add a file to my os but the issue is i don't know how can i include it to the kernal or the iso so i can use it |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Ok, so in the VS solution explorer right click the file you wanna embed and click properties. Then select using IL2CPU.API.Attribs; Then add this inside your kernel class (or wherever you want to have the variable for using it) [ManifestResourceStream(ResourceName = “Namespace.Folder.Filename.extension”)]
static readonly byte[] rawFileData; If for example you add a text file you would do this to get it in a string static readonly string fileData = new string(rawFileData); And thats about it. Note that this code is pseudocode and its not tested but it should work if you change the necessary stuff |
Beta Was this translation helpful? Give feedback.
-
there is a cosmos documantation page about adding resources ceck it out (click me) |
Beta Was this translation helpful? Give feedback.
Ok, so in the VS solution explorer right click the file you wanna embed and click properties. Then select
Embedded Resource
in the drop down box. Then add this to your using directiveThen add this inside your kernel class (or wherever you want to have the variable for using it)
If for example you add a text file you would do this to get it in a string
And thats about it. Note that this code is pseudocode and its not tested but it should work if you change the necessary stuff