zoukankan
html css js c++ java
两种模式的资源管理器代码之———— 重命名文件夹
1)
/***改名***/
#region
/***改名***/
/**/
///
<summary>
///
重命名文件夹
///
</summary>
public
void
Rename()
{
TreeNode node
=
this
._tree.SelectedNode;
DirectoryInfo dirObj
=
this
.GetDirObj(node);
if
(dirObj.Attributes.ToString().IndexOf(
"
ReadOnly
"
)
!=
-
1
)
return
;
inReNameMode
=
true
;
this
.RenameSelectedNode();
}
#endregion
/***LabelEdit***/
#region
/***LabelEdit***/
private
bool
inReNameMode
=
false
;
private
void
_tree_AfterLabelEdit(
object
sender, NodeLabelEditEventArgs e)
{
TreeNode node
=
this
._tree.SelectedNode;
if
(inReNameMode)
{
if
(e.Label
==
null
)
return
;
string
newPath
=
this
.GetNodePathStr(node.Parent)
+
e.Label;
DirectoryInfo dirObj
=
this
.GetDirObj(node);
try
{
dirObj.MoveTo(newPath);
}
catch
(Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
inReNameMode
=
false
;
}
}
}
#endregion
2)
/***重命名***/
#region
/***重命名***/
//
重命名
private
void
menuItem2_Click(
object
sender, System.EventArgs e)
{
oldFolder
=
this
.tv_Path.SelectedNode.Text;
this
.tv_Path.LabelEdit
=
true
;
this
.tv_Path.SelectedNode.BeginEdit();
}
#endregion
private void tv_Path_AfterLabelEdit(object sender, System.Windows.Forms.NodeLabelEditEventArgs e)
{
……
}
查看全文
相关阅读:
redis改配置
redis主从复制
nginx做维护页面
go_http
DRF源码-views.py
DRF教程10-关系字段
语言特性
DRF源码-fields.py
python_@classmethod
HTML5:定位
原文地址:https://www.cnblogs.com/flashicp/p/726904.html
最新文章
k8s-helm-v3安装管理
k8s-pod的健康检查
k8s-Ingress
k8s-Service
k8s-pod的资源控制器类型
洛谷P1908 逆序对【递归】
洛谷1498 南蛮图腾【递归】
洛谷P1074 靶形数独【dfs】【剪枝】
洛谷P1433 吃奶酪【dfs】【剪枝】
洛谷P1434 滑雪【记忆化搜索】
热门文章
洛谷P1118 数字三角形【dfs】【STL】
洛谷P1141 01迷宫【bfs】
洛谷1443 马的遍历【bfs】
洛谷P1126 机器人搬重物【bfs】
洛谷P1032 字串变换【bfs】
洛谷P1162 填涂颜色【bfs】
洛谷P1040 加分二叉树【记忆化搜索】
洛谷P1605 迷宫【dfs】
洛谷P1101 单词方阵【暴力】【字符串】
<深入理解redis>读书笔记
Copyright © 2011-2022 走看看