xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 14KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-07
  • 語言: C#
  • 標簽: asp.net??

資源簡介

C# 動態復制多個文件的源碼,高手跳過 C# 動態復制多個文件的源碼,高手跳過

資源截圖

代碼片段和文件信息

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;
//download?by?http://www.codefans.net
using?System.IO;
namespace?Case09_9
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}

????????private?void?button3_Click(object?sender?EventArgs?e)
????????{
????????????if?(textBox2.Text?!=?““)
????????????{
????????????????foreach?(object?o?in?listBox1.SelectedItems)??????//利用foreach循環把源目錄中選擇的文件復制到目標文件夾中
????????????????{
????????????????????File.Copy(textBox1.Text?+?“\\“?+?o.ToString()?textBox2.Text?+?“\\“?+?o.ToString());
????????????????}
????????????????int?myx?=?listBox1.SelectedItems.Count;???????????????????//復制文件的個數
????????????????string?mystr?=?“已成功復制“?+?myx.ToString()?+?“個文件“;
????????????????MessageBox.Show(this?mystr?“信息提示“?MessageBoxButtons.OK?MessageBoxIcon.Information);
????????????}
????????????else
????????????{
????????????????MessageBox.Show(this?“目標文件夾不能為空!“?“信息提示“?MessageBoxButtons.OK?MessageBoxIcon.Information);
????????????}
????????}

????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????folderBrowserDialog1.ShowDialog();???????//瀏覽文件夾對話框
????????????textBox1.Text?=?folderBrowserDialog1.SelectedPath;????//提取源目錄路徑及名稱
????????????if?(textBox1.Text?!=?““)
????????????{
????????????????DirectoryInfo?dir?=?new?DirectoryInfo(textBox1.Text);
????????????????FileInfo[]?f?=?dir.GetFiles();?????????//提取源目錄中所有文件
????????????????for?(int?i?=?0;?i?????????????????{
????????????????????listBox1.Items.Add(f[i]);?????//利用for循環添加到列表框中
????????????????}
????????????}
????????????else
????????????{
????????????????MessageBox.Show(this?“沒有選擇源文件夾!“?“信息提示“?MessageBoxButtons.OK?MessageBoxIcon.Information);
????????????}

????????}

????????private?void?button2_Click(object?sender?EventArgs?e)
????????{
????????????folderBrowserDialog1.ShowDialog();??????//瀏覽文件夾對話框
????????????textBox2.Text?=?folderBrowserDialog1.SelectedPath;
????????}

????????private?void?button4_Click(object?sender?EventArgs?e)
????????{
????????????this.Close();
????????????Application.Exit();
????????}
????}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

-----------?---------??----------?-----??----

????????????????48655????????????????????16


評論

共有 條評論