zoukankan
html css js c++ java
两种模式的资源管理器代码之———— 删除文件夹
1)
/***删除文件夹***/
#region
/***删除文件夹***/
/**/
///
<summary>
///
删除文件夹
///
</summary>
public
void
Delete()
{
TreeNode node
=
_tree.SelectedNode;
DirectoryInfo dirObj
=
GetDirObj(node);
dirObj.Delete(
true
);
//
删除文件夹、其子文件夹与文件
this
.DeleteSelectedNode();
this
.FileLstCtl.Clear();
}
#endregion
/**/
///
<summary>
///
删除选中的节点
///
</summary>
private
void
DeleteSelectedNode()
{
try
{
_tree.Nodes.Remove(_tree.SelectedNode);
_tree.SelectedNode
=
null
;
}
catch
{}
}
2)
/***删除***/
#region
/***删除***/
//
删除
private
void
menuItem3_Click(
object
sender, System.EventArgs e)
{
string
path
=
this
.pre_Path
+
this
.tv_Path.SelectedNode.FullPath;
//
删除确认
DialogResult result
=
MessageBox.Show(
this
,
"
您确认要删除吗?
"
,
"
删除文件夹
"
,
MessageBoxButtons.YesNo,
MessageBoxIcon.Question,MessageBoxDefaultButton.Button1);
if
(result
==
DialogResult.Yes)
{
if
(FoloderControl.DirectDel(path))
{
this
.tv_Path.Nodes.Remove(
this
.tv_Path.SelectedNode);
//
MessageBox.Show(this,"删除成功","提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
}
}
#endregion
查看全文
相关阅读:
eureka流程图
Feign和Ribbon的重试机制
idea编译kafka 2.6 源码
Feign的调用流程
FeignClientFactoryBean创建动态代理
Feign源码的入口
Ribbon的检查服务
Ribbon是怎么和Eureka整合的?
Eureka过期
backup: sqlHelper --cSharp
原文地址:https://www.cnblogs.com/flashicp/p/726911.html
最新文章
[Aix6.1]查看Oracle版本
[CentOS7]关闭25端口
[Windows2019]安全策略阻止未经身份验证的来宾访问
[VMware]升级兼容性列表
[ESXi6]未知虚拟机清理
[Shell]For大括号{}
[VMware]虚拟机需要整合状态
[CentOS7]源码安装Screen 4.8.0
[CentOS7]Can't exec "aclocal": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 326.
长链剖分 学习笔记
热门文章
题解 [JSOI2015]最小表示
2021-10-21 集训补题
[CSP-S2020] 函数调用 & 贪吃蛇
题解 Count on a tree II/【模板】树分块
题解 [NOIP2020] 移球游戏
题解 CF1392G Omkar and Pies
题解 Game with Strings
题解 门童
题解 AVL 树
ribbon流程图
Copyright © 2011-2022 走看看