{"id":198,"date":"2010-04-28T18:44:58","date_gmt":"2010-04-28T18:44:58","guid":{"rendered":"https:\/\/ibex.tech\/visualcpp\/?p=198"},"modified":"2022-02-17T06:24:05","modified_gmt":"2022-02-17T06:24:05","slug":"user-select-directory-example","status":"publish","type":"post","link":"https:\/\/ibex.tech\/visualcpp\/file-input-output-serialization\/user-select-directory-example","title":{"rendered":"User select directory example"},"content":{"rendered":"<pre><code>\r\n\tString ^SelectedDirectory;\r\n\r\n\tFolderBrowserDialog ^SelectFolderDialog = gcnew FolderBrowserDialog();\r\n\t\t\t\r\n\t\/\/Setup dialog box\r\n\tSelectFolderDialog->Description = \"Select directory to store files to\";\r\n\tSelectFolderDialog->ShowNewFolderButton = true;\r\n\tSelectFolderDialog->RootFolder = System::Environment::SpecialFolder::Desktop;\r\n\ttry\r\n\t{\r\n\t\tSelectFolderDialog->SelectedPath = SelectedDirectory;\t\t\/\/Try and use last selection\r\n\t}\r\n\tcatch (Exception ^)\r\n\t{\r\n\t}\r\n\r\n\t\/\/Display dialog box\r\n\tif (SelectFolderDialog->ShowDialog() == System::Windows::Forms::DialogResult::OK)\r\n\t{\r\n\t\tSelectedDirectory = SelectFolderDialog->SelectedPath;\r\n\r\n\t\t\/\/.............\r\n\t}\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>String ^SelectedDirectory; FolderBrowserDialog ^SelectFolderDialog = gcnew FolderBrowserDialog(); \/\/Setup dialog box SelectFolderDialog->Description = &#8220;Select directory to store files to&#8221;; SelectFolderDialog->ShowNewFolderButton = true; SelectFolderDialog->RootFolder = System::Environment::SpecialFolder::Desktop; try { SelectFolderDialog->SelectedPath = SelectedDirectory; \/\/Try and use last selection } catch (Exception ^) { } \/\/Display dialog box if (SelectFolderDialog->ShowDialog() == System::Windows::Forms::DialogResult::OK) { SelectedDirectory = SelectFolderDialog->SelectedPath; \/\/&#8230;&#8230;&#8230;&#8230;. }<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-198","post","type-post","status-publish","format-standard","hentry","category-file-input-output-serialization"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/comments?post=198"}],"version-history":[{"count":3,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/198\/revisions"}],"predecessor-version":[{"id":1127,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/198\/revisions\/1127"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/media?parent=198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/categories?post=198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/tags?post=198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}