保存成功后的提示操作 - MessageBoxDirShowYesNoCancel
2017-01-26 10:03:42 访问(1688) 赞(0) 踩(0)
/// <summary>
/// 保存成功后的提示操作 - MessageBoxDirShowYesNoCancel
/// </summary>
/// <param name="dirName"></param>
public void MessageBoxDirShowYesNoCancel
(
string dirName
)
{
string tips = "保存成功,是否复制目录或打开目录(点No)?";
DialogResult dg = MessageBox.Show(
tips, "选择操作", MessageBoxButtons.YesNoCancel);
if (dg == DialogResult.Cancel)
return;
if (dg == DialogResult.No)
{
System.Diagnostics.Process.Start("explorer.exe", dirName);
return;
}
if (dg == DialogResult.Yes)
{
System.Collections.Specialized.StringCollection stringCollectionValue
= new System.Collections.Specialized.StringCollection();
DirectoryInfo directoryInfoValue = new DirectoryInfo(dirName);
FileSystemInfo[] fsi = directoryInfoValue.GetFileSystemInfos();
if (fsi != null)
{
foreach (FileSystemInfo i in fsi)
{
stringCollectionValue.Add(i.FullName);
}
}
Clipboard.SetFileDropList(stringCollectionValue);
}
}
标签:
保存成功后的提示操作 - MessageBoxDirShowYesNoCancel 


上一条:
下一条:
相关评论
发表评论