c# - Open folder issue -
i want open folder file had been saved , select file, use little code:
var psi = new processstartinfo("explorer.exe", "/select," + dlg.filename); process.start(psi);
it works perfectly.
i need put code in several places decided create method, there condition in method:
private static void openfolderandselectmyfile(string filename) { if (mysettings.default.openfolder == true) { var psi = new processstartinfo("explorer.exe", "/select," + filename); psi.windowstyle = processwindowstyle.maximized; process.start(psi); } }
this doesn't work expected: opens parent folder (of folder containing file). selects folder.
why difference in behavior , how solve it?
the way occur, filename
isn't in original code. code same, , work expected, if filename
in fact in original code location.
it's filename
full path folder rather full path file including file name.
Comments
Post a Comment