public void LoadLibrary(Thread thread, string filename) { string pathname = Path.GetFullPath(filename); if (!File.Exists(pathname)) { throw new ScriptingException( "No such file: `{0}'", pathname); } try { CurrentProcess.LoadLibrary(thread, pathname); } catch (TargetException ex) { throw new ScriptingException( "Cannot load library `{0}': {1}", pathname, ex.Message); } Print("Loaded library {0}.", filename); }