![browse browse]()
那只是1.1。如果您在1.0中,升级到1.1或在网站上找到一些来源。 http://support.microsoft.com/?kbid=306285 -Eric 这里有一句话, 这个类仅在框架的1.1版中可用。 问候, Bram " Bill Styles" <无***** @ nowhere.com>在消息中写道 news:ek ************** @ TK2MSFTNGP11.phx.gbl ... " Ryan Trevisol" < RY *********** @ bellsouth.net>在消息中写道新闻:55 ********************************** @ microsof t.com 我正在尝试找到可以用来获取浏览文件夹的类。类似于SHBrowseForFolder的对话框,在C#中。我似乎无法找到任何接近的东西。 System.Windows.Forms.FolderBrowserDialog browse = 新的System.Windows.Forms.FolderBrowserDialog (); browse.ShowNewFolderButton = false; browse.Description ="请选择一个文件夹" ;; browse.RootFolder = System.Environment.SpecialFolder .DesktopDirectory; 浏览.SelectedPath =" apps"; if(browse.ShowDialog()== System.Windows.Forms.DialogR esult.OK) MessageBox.Show(browse.SelectedPath); else MessageBox.Show(" Cancelled"); - C#newbie ...帖子可能不准确,不优雅或两者都 I''m attempting to find the class that I can use to get a "Browse For Folder" dialog similar to SHBrowseForFolder, in C#. I can''t seem to find anything that comes close. I''m developing a small, small application to create M3U Playlists from my hierarchical organization of digital audio. I have the application working but I want to give myself the ability to easily select both the starting folder (on my file server), and the output folder (a local folder on my various PCs and laptops around the house). An OpenFileDialog just won''t do the trick. I need that BrowseForFolder dialog. . . . but haven''t found it in the Framework I know I could create a dialog with a TreeView and buttons that would approximate my needs, but why should I add an entire logical tree-and-node structure to a program that''s got less than 300 lines of code? As everyone is saying these days, "why reinvent the wheel" Thanks for any help you can give Ryan T 解决方案 "Ryan Trevisol" <ry***********@bellsouth.net> wrote in messagenews:55**********************************@microsof t.com I''m attempting to find the class that I can use to get a "Browse For Folder" dialog similar to SHBrowseForFolder, in C#. I can''t seem to find anything that comes close. System.Windows.Forms.FolderBrowserDialog browse =new System.Windows.Forms.FolderBrowserDialog();browse.ShowNewFolderButton = false;browse.Description="Please select a folder";browse.RootFolder=System.Environment.SpecialFolder .DesktopDirectory;browse.SelectedPath = "apps";if (browse.ShowDialog()==System.Windows.Forms.DialogR esult.OK)MessageBox.Show(browse.SelectedPath);elseMessageBox.Show("Cancelled");--C# newbie... posts are probably inaccurate, inelegant or both That''s only in 1.1. If your in 1.0, upgrade to 1.1 or find some source onthe web. http://support.microsoft.com/?kbid=306285-EricHi, One remark here,this class is only available in version 1.1 of the framework. Greetings, Bram "Bill Styles" <no*****@nowhere.com> wrote in messagenews:ek**************@TK2MSFTNGP11.phx.gbl... "Ryan Trevisol" <ry***********@bellsouth.net> wrote in message news:55**********************************@microsof t.com I''m attempting to find the class that I can use to get a "Browse For Folder" dialog similar to SHBrowseForFolder, in C#. I can''t seem to find anything that comes close. System.Windows.Forms.FolderBrowserDialog browse = new System.Windows.Forms.FolderBrowserDialog(); browse.ShowNewFolderButton = false; browse.Description="Please select a folder"; browse.RootFolder=System.Environment.SpecialFolder .DesktopDirectory; browse.SelectedPath = "apps"; if (browse.ShowDialog()==System.Windows.Forms.DialogR esult.OK) MessageBox.Show(browse.SelectedPath); else MessageBox.Show("Cancelled"); -- C# newbie... posts are probably inaccurate, inelegant or both 这篇关于我需要一个C#中的BrowseForFolder!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-26 19:06