《更改名》软件源代码.docx

上传人:M****1 文档编号:543930149 上传时间:2023-12-11 格式:DOCX 页数:18 大小:150.38KB
返回 下载 相关 举报
《更改名》软件源代码.docx_第1页
第1页 / 共18页
《更改名》软件源代码.docx_第2页
第2页 / 共18页
《更改名》软件源代码.docx_第3页
第3页 / 共18页
《更改名》软件源代码.docx_第4页
第4页 / 共18页
《更改名》软件源代码.docx_第5页
第5页 / 共18页
点击查看更多>>
资源描述

《《更改名》软件源代码.docx》由会员分享,可在线阅读,更多相关《《更改名》软件源代码.docx(18页珍藏版)》请在金锄头文库上搜索。

1、更改文件名软件源代码一、主界面:用到的控件:主界面“Form1”页面源码:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.IO;using System.Windows.Forms.Design;namespace Files public partial class

2、Files : Form public Files() InitializeComponent(); private void btnFile_Click(object sender, EventArgs e) FolderDialog openFolder = new FolderDialog(); if (openFolder.DisplayDialog() = DialogResult.OK) txtselectPath.Text = openFolder.Path.ToString(); txtOutPath.Text = txtselectPath.Text; else txtsel

3、ectPath.Text = 你没有选择目录; private void getAllDir(string path,string status,string newName) if (Directory.Exists(path) string fileList = Directory.GetFileSystemEntries(path); /this.listview1.BeginUpdate(); /数据更新,UI暂时挂起,直到EndUpdate绘制控件,可以有效避免闪烁并大大提高加载速度 foreach (string file in fileList) FileInfo fi = ne

4、w FileInfo(file); if (Directory.Exists(file) getAllDir(file,status,newName); else ListViewItem lvi = new ListViewItem(); /lvi.Text =Path.GetFileName(file) ; /lvi.SubItems.Add(file); /lvi.SubItems.Add(newName); /lvi.SubItems.Add(status); /this.listview1.Items.Add(lvi); switch (uControl.StaSize) case

5、1: time(status, newName, file, fi, lvi); break; case 2: if(fi.Length=102400) time(status, newName, file, fi, lvi); break; case 3: if(fi.Length=(1024*1024*1024) time(status, newName, file, fi, lvi); break; case 5: if(uControl.ComBox=1) if(fi.Length=(uControl.num*1024*1024*1024) time(status, newName,

6、file, fi, lvi); if(uControl.ComBox=2) if(fi.Length(uControl.num*1024*1024*1024) time(status, newName, file, fi, lvi); break; /this.listview1.EndUpdate(); /结束数据处理,UI界面一次性绘制。 private void time(string status, string newName, string file, FileInfo fi, ListViewItem lvi) switch (uControl.StaTime) case 1: lvi.Text = Path.GetFileName(file); lvi.SubItems.Add(file); lvi.SubItems.Add(newName); lvi.SubItems.Add(status); this.listview1.Items.Add(lvi); break; case 2:

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 社会民生

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号