|
技术资料 > .Net专区 > Asp.Net开发 : 选择文件夹的对话框 |
选择文件夹的对话框 March 25,2004 |
public class FolderDialog : FolderNameEditor
{
FolderNameEditor.FolderBrowser fDialog = new System.Windows.Forms.Design.FolderNameEditor.FolderBrowser();
public FolderDialog()
{
}
public DialogResult DisplayDialog()
{
return DisplayDialog("请选择一个文件夹");
}
public DialogResult DisplayDialog(string description)
{
fDialog.Description = description;
return fDialog.ShowDialog();
}
public string Path
{
get
{
return fDialog.DirectoryPath;
}
}
~FolderDialog()
{
fDialog.Dispose();
}
}
使用:
FolderDialog openFolder = new FolderDialog();
openFolder.DisplayDialog();
唉,真是千辛万苦才找到阿!连Shell API都用上了!最后终于让我看到了它!哈哈,爽
|
|
Copyright © 2001-2008 Shenzhen Hiblue Software Team All rights reserved