hello
here the code to genereate a lot of small files. it replicates c:\autoexec.bat into a newly generated dir c:\a with subdirs d1 ... d5, 4'000 repicas in each of those folders.
After running the program (3 files - compile it, start it, push the button, wait til final message after about 1 - 2 minutes) you can copy c:\a to some other location - thats the moment where i (and others) get the error.
Here the command lines (from within command tool, from dir where you put the following 3 files):
PATH=C:\Windows\Microsoft.NET\Framework\v2.0.50727
Csc.exe Form1.cs Form1.Designer.cs Program.cs
program.exe
=== file 1: Form.cs ===
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public string sDir = "C:/A/";
public string sInF = "C:/autoexec.bat";
public Form1()
{
InitializeComponent();
}
private void buttonErstelle_Click(object sender, EventArgs e)
{
int idt = 0;
int id = Convert.ToInt32(textBoxDateienJeVerzeichnis.Text);
int iv = Convert.ToInt32(textBoxVerzeichnisse.Text);
for (int ivw = 1; ivw <= iv; ivw++)
{
textBoxFeedback.Text = "makeing Directory " + sDir + "D" + ivw;
Directory.CreateDirectory("" + sDir + "D" + ivw);
for (int idw = 1; idw <= id; idw++)
{
textBoxFeedback.Text = "makeing File " + sDir + "D" + ivw + "/F" + (idw + idt) + ".TXT";
File.Copy(sInF, sDir + "D" + ivw + "/F" + (idw + idt) + ".TXT");
}
idt += id;
}
textBoxFinal.Text = "Now drag/drop " + sDir + " with Vista Explorer somewhere else";
}
}
}
=== file 2: Program.cs ===
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace WindowsApplication1
{
static class Program
{
/// <summary>
/// Der Haupteinstiegspunkt für die Anwendung.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
=== file 3: Form1.Designer.cs ===
namespace WindowsApplication1
{
partial class Form1
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Windows Form-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.textBoxDateienJeVerzeichnis = new System.Windows.Forms.TextBox();
this.textBoxVerzeichnisse = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.buttonErstelle = new System.Windows.Forms.Button();
this.textBoxFeedback = new System.Windows.Forms.TextBox();
this.textBoxFinal = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(102, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Files on each Folder";
//
// textBoxDateienJeVerzeichnis
//
this.textBoxDateienJeVerzeichnis.Location = new System.Drawing.Point(132, 13);
this.textBoxDateienJeVerzeichnis.Name = "textBoxDateienJeVerzeichnis";
this.textBoxDateienJeVerzeichnis.Size = new System.Drawing.Size(277, 20);
this.textBoxDateienJeVerzeichnis.TabIndex = 1;
this.textBoxDateienJeVerzeichnis.Text = "4000";
//
// textBoxVerzeichnisse
//
this.textBoxVerzeichnisse.Location = new System.Drawing.Point(132, 40);
this.textBoxVerzeichnisse.Name = "textBoxVerzeichnisse";
this.textBoxVerzeichnisse.Size = new System.Drawing.Size(277, 20);
this.textBoxVerzeichnisse.TabIndex = 3;
this.textBoxVerzeichnisse.Text = "5";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(13, 40);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(41, 13);
this.label2.TabIndex = 2;
this.label2.Text = "Folders";
//
// buttonErstelle
//
this.buttonErstelle.Location = new System.Drawing.Point(16, 69);
this.buttonErstelle.Name = "buttonErstelle";
this.buttonErstelle.Size = new System.Drawing.Size(393, 23);
this.buttonErstelle.TabIndex = 4;
this.buttonErstelle.Text = "Generate !";
this.buttonErstelle.UseVisualStyleBackColor = true;
this.buttonErstelle.Click += new System.EventHandler(this.buttonErstelle_Click);
//
// textBoxFeedback
//
this.textBoxFeedback.Location = new System.Drawing.Point(16, 99);
this.textBoxFeedback.Name = "textBoxFeedback";
this.textBoxFeedback.Size = new System.Drawing.Size(393, 20);
this.textBoxFeedback.TabIndex = 5;
this.textBoxFeedback.Text = "(-)";
//
// textBoxFinal
//
this.textBoxFinal.Location = new System.Drawing.Point(16, 125);
this.textBoxFinal.Name = "textBoxFinal";
this.textBoxFinal.Size = new System.Drawing.Size(393, 20);
this.textBoxFinal.TabIndex = 6;
this.textBoxFinal.Text = "(-)";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(421, 162);
this.Controls.Add(this.textBoxFinal);
this.Controls.Add(this.textBoxFeedback);
this.Controls.Add(this.buttonErstelle);
this.Controls.Add(this.textBoxVerzeichnisse);
this.Controls.Add(this.label2);
this.Controls.Add(this.textBoxDateienJeVerzeichnis);
this.Controls.Add(this.label1);
this.Name = "Form1";
this.Text = "simmons Vista Explorer Test";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBoxDateienJeVerzeichnis;
private System.Windows.Forms.TextBox textBoxVerzeichnisse;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button buttonErstelle;
private System.Windows.Forms.TextBox textBoxFeedback;
private System.Windows.Forms.TextBox textBoxFinal;
}
}
here the code to genereate a lot of small files. it replicates c:\autoexec.bat into a newly generated dir c:\a with subdirs d1 ... d5, 4'000 repicas in each of those folders.
After running the program (3 files - compile it, start it, push the button, wait til final message after about 1 - 2 minutes) you can copy c:\a to some other location - thats the moment where i (and others) get the error.
Here the command lines (from within command tool, from dir where you put the following 3 files):
PATH=C:\Windows\Microsoft.NET\Framework\v2.0.50727
Csc.exe Form1.cs Form1.Designer.cs Program.cs
program.exe
=== file 1: Form.cs ===
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public string sDir = "C:/A/";
public string sInF = "C:/autoexec.bat";
public Form1()
{
InitializeComponent();
}
private void buttonErstelle_Click(object sender, EventArgs e)
{
int idt = 0;
int id = Convert.ToInt32(textBoxDateienJeVerzeichnis.Text);
int iv = Convert.ToInt32(textBoxVerzeichnisse.Text);
for (int ivw = 1; ivw <= iv; ivw++)
{
textBoxFeedback.Text = "makeing Directory " + sDir + "D" + ivw;
Directory.CreateDirectory("" + sDir + "D" + ivw);
for (int idw = 1; idw <= id; idw++)
{
textBoxFeedback.Text = "makeing File " + sDir + "D" + ivw + "/F" + (idw + idt) + ".TXT";
File.Copy(sInF, sDir + "D" + ivw + "/F" + (idw + idt) + ".TXT");
}
idt += id;
}
textBoxFinal.Text = "Now drag/drop " + sDir + " with Vista Explorer somewhere else";
}
}
}
=== file 2: Program.cs ===
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace WindowsApplication1
{
static class Program
{
/// <summary>
/// Der Haupteinstiegspunkt für die Anwendung.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
=== file 3: Form1.Designer.cs ===
namespace WindowsApplication1
{
partial class Form1
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Windows Form-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.textBoxDateienJeVerzeichnis = new System.Windows.Forms.TextBox();
this.textBoxVerzeichnisse = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.buttonErstelle = new System.Windows.Forms.Button();
this.textBoxFeedback = new System.Windows.Forms.TextBox();
this.textBoxFinal = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(102, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Files on each Folder";
//
// textBoxDateienJeVerzeichnis
//
this.textBoxDateienJeVerzeichnis.Location = new System.Drawing.Point(132, 13);
this.textBoxDateienJeVerzeichnis.Name = "textBoxDateienJeVerzeichnis";
this.textBoxDateienJeVerzeichnis.Size = new System.Drawing.Size(277, 20);
this.textBoxDateienJeVerzeichnis.TabIndex = 1;
this.textBoxDateienJeVerzeichnis.Text = "4000";
//
// textBoxVerzeichnisse
//
this.textBoxVerzeichnisse.Location = new System.Drawing.Point(132, 40);
this.textBoxVerzeichnisse.Name = "textBoxVerzeichnisse";
this.textBoxVerzeichnisse.Size = new System.Drawing.Size(277, 20);
this.textBoxVerzeichnisse.TabIndex = 3;
this.textBoxVerzeichnisse.Text = "5";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(13, 40);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(41, 13);
this.label2.TabIndex = 2;
this.label2.Text = "Folders";
//
// buttonErstelle
//
this.buttonErstelle.Location = new System.Drawing.Point(16, 69);
this.buttonErstelle.Name = "buttonErstelle";
this.buttonErstelle.Size = new System.Drawing.Size(393, 23);
this.buttonErstelle.TabIndex = 4;
this.buttonErstelle.Text = "Generate !";
this.buttonErstelle.UseVisualStyleBackColor = true;
this.buttonErstelle.Click += new System.EventHandler(this.buttonErstelle_Click);
//
// textBoxFeedback
//
this.textBoxFeedback.Location = new System.Drawing.Point(16, 99);
this.textBoxFeedback.Name = "textBoxFeedback";
this.textBoxFeedback.Size = new System.Drawing.Size(393, 20);
this.textBoxFeedback.TabIndex = 5;
this.textBoxFeedback.Text = "(-)";
//
// textBoxFinal
//
this.textBoxFinal.Location = new System.Drawing.Point(16, 125);
this.textBoxFinal.Name = "textBoxFinal";
this.textBoxFinal.Size = new System.Drawing.Size(393, 20);
this.textBoxFinal.TabIndex = 6;
this.textBoxFinal.Text = "(-)";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(421, 162);
this.Controls.Add(this.textBoxFinal);
this.Controls.Add(this.textBoxFeedback);
this.Controls.Add(this.buttonErstelle);
this.Controls.Add(this.textBoxVerzeichnisse);
this.Controls.Add(this.label2);
this.Controls.Add(this.textBoxDateienJeVerzeichnis);
this.Controls.Add(this.label1);
this.Name = "Form1";
this.Text = "simmons Vista Explorer Test";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBoxDateienJeVerzeichnis;
private System.Windows.Forms.TextBox textBoxVerzeichnisse;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button buttonErstelle;
private System.Windows.Forms.TextBox textBoxFeedback;
private System.Windows.Forms.TextBox textBoxFinal;
}
}