c# - Relative Paths of File.Open() in a DLL -


i'm working on solidworks plugin (dll). depends on couple of files (sqlite db, sketches etc). install plugin, have open dll solidworks.

in dll routines call file.open() on number of resource files i'll refer relative paths. dir. hierarchy like:

plugin/     plugin.dll     sketches/         various.sldprt     otherfile.db     otherdeps.txt     ... 

where root dir. of plugin can anywhere on system. plugin can loaded solidworks open file dialog. problem once load dll, calls file.open() (eg file.open("sketches/various.sldprt")) relative paths won't work because it'll relative dir. sldworks.exe (sw install dir.) resides instead of dir. of dll. mean i'll have put resource files in solidworks install dir., avoid. possible?

what can add addin folder prefix local path before calling file.open(). addin folder can obtained :

string path = system.io.path.getdirectoryname(        system.reflection.assembly.getexecutingassembly().getname().codebase ); 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -