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