C# - 创建具有特定名称的多个文件

C# - creating multiple files with specific names

我已经开始学习 C# 中的 System.IO,我想实现这样的目标:

到目前为止我的按钮和文本框事件:

...
int value;
String path;
private void button1_Click(object sender, EventArgs e)
{
    FolderBrowserDialog fbd = new FolderBrowserDialog();
    if (fbd.ShowDialog(this) == DialogResult.OK)
    {
        MessageBox.Show(fbd.SelectedPath);
        path = folderBrowserDialog1.SelectedPath;//store selected path to variable "path"
    }
}

private void textBox1_TextChanged(object sender, EventArgs e)
{
    value = Convert.ToInt32(textBox1.Text);//store the value from the textbox in variable "value"
}

private void button2_Click(object sender, EventArgs e)
{
    if (!Directory.Exists(path))//if selected path exists
    {
        for(int i=0;i<value;i++)//trying to go through as folders as I wrote in the TextBox
        {           
            Directory.CreateDirectory(path + "something");//is something wrong here, I guess.
        } 
     }  
}

我目前的问题:

如有任何帮助,我将不胜感激

int value;
string path = null;

private void button1_Click(object sender, EventArgs e)
{
    FolderBrowserDialog fbd = new FolderBrowserDialog();
    if (fbd.ShowDialog(this) == DialogResult.OK)
    {
        MessageBox.Show(fbd.SelectedPath);
        path = fbd.SelectedPath; //fbd not folderBrowserDialog1

    }
}

private void textBox1_TextChanged(object sender, EventArgs e)
{
    value = Convert.ToInt32(textBox1.Text);//store the value from the textbox in variable "value"
}

private void button2_Click(object sender, EventArgs e)
{
    if (path != null && Directory.Exists(path))
        for(int i=0;i<value;i++)
            Directory.CreateDirectory(Path.Combine(path,string.Format("SomeFolder{0}",i)));
}