2013-03-18 29 views
-1

文件夾的表我想模仿使用Visual C#下面的圖像的功能:清單採用C#

Uploaded image

這我知道是不是textboxcomboboxrichtext(也許)。 我設法讓add函數,在這裏我得到的目錄,我可以選擇其中:

private void button8_Click(object sender, EventArgs e) 
{ 
    this.folderBrowserDialog1.ShowNewFolderButton = false; 
    this.folderBrowserDialog1.RootFolder = System.Environment.SpecialFolder.MyComputer; 
    DialogResult result = this.folderBrowserDialog1.ShowDialog(); 
    if (result == DialogResult.OK) 
    { 
     // the code here will be executed if the user selects a folder 
     string path = this.folderBrowserDialog1.SelectedPath; 
    } 
} 

如何列出他們喜歡的形象,我應該把它寫入一個ini文件或XML文件,那麼如果是這樣的話,我怎麼把它列出來,如圖所示。

我還需要檢測操作系統,並在列表中有幾個默認文件夾。

回答

0

不太清楚你想要什麼,但圖像顯示一個字符串和布爾值的列表。所以,你可以使用這樣的事情:

public class DirOptions 
{ 
    string Path = string.Empty; 
    bool IncludeSubDirs = false; 
} 

然後你可以存儲列表中的數據<>:

var list = new List<DirOptions>(); 

要檢測OS:

請參閱此問題Get OS Version/Friendly Name in C#

+0

謝謝@AlinaB我會使用這個並回來。再次感謝你。 – 2013-03-18 11:09:26