Xojo.IO.SpecialFolder.GetResource

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Method

Xojo.IO.SpecialFolder.GetResource(name As Text) As Xojo.IO.FolderItem

Supported for all project types and targets.

Gets the specified file (by name) located in the Resource folder of the app's main bundle (Mac or iOS) or in the Resource folder on Windows, Linux and console apps.

Notes

Use a Copy Files Build Step to copy files into the Resource folder.

fa-exclamation-circle-32.png
An InvalidArgumentException will be raised if the file the does not exist.

Sample Code

Gets a file that has been copied to the Resource folder:

Dim bundleFile As Xojo.IO.Folderitem
bundleFile = Xojo.IO.SpecialFolder.GetResource("AppDatabase.sqlite")