how to parse multiple file names and get relevant information in C# asp aspx <p>I've been trying to figure out a way for the program to read all of the files from the path or zip file as input. Than read all of the file names inside of the input folder and split it so I can get information such as what is product id and chip name. Than store the pdf file in the correct db that matches with the product id and chip name. </p> <p>The product id would be KHSA1234C and chip name LK454154.</p> <p>Example File name: N3405-H-KAD_K-KHSA1234C-542164143_LK454154_GFK.pdf</p> <pre><code>public void btnUploadAttach_Click(object sender, EventArgs e) { string fName = this.FileUploadCFC.FileName; string path = @"C:\mydir\"; string result; result = Path.GetFileNameWithoutExtension(fName); Console.WriteLine("GetFileNameWithoutExtension('{0}') return '{1}'", fName, result); result = Path.GetFileName(path); Console.WriteLine("GetFileName('{0}') return '{1}'", path, result); string[] sSplitFileName = fName.ToUpper().Split("-".ToCharArray()); foreach (char file in fName) { try { result = sSplitFileName[0] + "_" + sSplitFileName[1] + "-" + sSplitFileName[2] + "_" + sSplitFileName[3] + "_" + sSplitFileName[4] + "_" + sSplitFileName[5] + "_" + sSplitFileName[6]; } catch { return; } } } </code></pre> <p>I don't know if I'm on the right track or not. Can someone help me? Thank you.</p>