Using License File


The online documentation indicates that the license file should be called using the following code.

string currentDir = System.IO.Directory.GetCurrentDirectory();

This string works on a development machine, but when put on a test computer it returns C:.

For WinForms the following has worked for me assuming the license file is in the same folder as the executable.

private string GetAppPath()
// build the app path string
string appPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
int lastIndex = appPath.LastIndexOf("\");

return appPath.Remove(lastIndex, appPath.Length - lastIndex); // removes everything after the last \ (the exe filename)