. net winform
Now I get all the fileName under the specified directory. the result is "0001_00001523_028155.sql"
but my goal is only to get "00001523"
how can I do that?
private void loadscriptfolder()
{
string folderName = this.textBoxScriptLocation.Text.Trim();
DirectoryInfo dir = new DirectoryInfo(folderName);
if (dir.Exists)
{
FileSystemInfo[] fs = dir.GetFileSystemInfos();
foreach (FileSystemInfo fs2 in fs)
{
FileInfo file = fs2 as FileInfo;
if (file != null)
{
listBoxResult.Items.Add(file);
}
}
}
}
Thank you everyone!!!