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)
{
……
}
查看全文
相关阅读:
Windows CA 证书服务器
IE7的web标准之道
mysql 密码重置
IIS 与 Apache共存
php 正则表达式
sql 记录
[ Python ] 迭代对象、迭代器、生成器
[ Python ] 文件的读写操作
[ Python ] 匿名函数和高阶函数
[ Python ] set集合及函数的使用
原文地址:https://www.cnblogs.com/flashicp/p/726904.html
最新文章
Pftriage:分析和追踪恶意文件,识别特征
ProtonMiner挖矿蠕虫
hackerone漏洞跟进
Linux下查询文件的md5,sha1值
SSH命令行管理文件
删除Myeclipse中废弃的workspace记录
Servlet 分页保存查询条件
MySQL 分组之后如何统计记录条数 gourp by 之后的 count()
sql左右连接的区别
SQL各种连接查询详解(左连接、右连接..)
热门文章
使用MyBatis查询int类型字段,返回NULL值时报异常的解决方法
Ajax异步刷新分页功能-MySQL
Mybatis 中在传参时,${} 和#{} 的区别
MyBatis动态SQL使用,传入参数Map中的Key判断
ServletFileUpload(Servlet文件上传)
SpringMVC--xxx.xml配置
MYSQL 表结构的修改
php ldap添加与修改
JS PHP MySQL 字符长度
今天遇到个PHP不知原因的报内部错误
Copyright © 2011-2022 走看看