0
我要出去放像1.2.3.4.5 ..但在这段代码中我喜欢的值到1,10,100,101升序排序丰富的文本框.. plz帮助我的朋友如何使用C#
private void btn_load_Click_1(object sender, EventArgs e)
{
{
if (textBox1.Text != "")
{
richTextBox1.Clear();
string tt = @"" + textBox1.Text;
String sdira = @"" + textBox1.Text;
string[] arrays = Directory.GetFiles(sdira, "*", SearchOption.AllDirectories)
.Select(x => Path.GetFileName(x))
.ToArray();// get only file name and extention
foreach (string name in arrays)
{
//StringBuilder sb = new StringBuilder();
richTextBox1.Text += name + "\n";
//i want get out put like 1.2.3.4.5..
//but in this code i got values like 1,10,100,101..
//plz help me friends[first img is my current out put][1]
}
}
}
textbox1.text包含什么? () –
您应该先对数据进行排序,然后将这些项目追加到'StringBuilder'中,最后将结果添加到'RichTextBox'中。 –
textbox1.text是路径 – dilhan