コード例 #1
0
        public static ActionResult BrowseDirectoryButton( Session session )
        {
            Thread thread = new Thread( (ThreadStart) delegate {
                using ( FolderBrowser2 dialog = new FolderBrowser2() ) {
                    dialog.DirectoryPath = session["INSTALLDIR"];
                    if ( dialog.ShowDialog() == DialogResult.OK ) {
                        session["INSTALLDIR"] =
                            Path.Combine( dialog.DirectoryPath, "UnofficialDDNS" ) + Path.DirectorySeparatorChar;
                    }
                }
            } );
            thread.SetApartmentState( ApartmentState.STA );
            thread.Start();
            thread.Join();

            return ActionResult.Success;
        }
コード例 #2
0
        public static ActionResult BrowseDirectoryButton(Session session)
        {
            Thread thread = new Thread((ThreadStart) delegate {
                using (FolderBrowser2 dialog = new FolderBrowser2()) {
                    dialog.DirectoryPath = session["INSTALLDIR"];
                    if (dialog.ShowDialog() == DialogResult.OK)
                    {
                        session["INSTALLDIR"] =
                            Path.Combine(dialog.DirectoryPath, "UnofficialDDNS") + Path.DirectorySeparatorChar;
                    }
                }
            });

            thread.SetApartmentState(ApartmentState.STA);
            thread.Start();
            thread.Join();

            return(ActionResult.Success);
        }