Hi,
oe folder gpf inside Edn ,Af,Pol like folder ,iside folder same no multiple pdf doc like Gpf/Af/Af_10008_pw.pdf,Af_10008_as.pdf,
Af_10008_df.pdf like multpile files ased and Categery And gpf no Serch get path and update related columns like Af_10008 i pass input how can i get all this 3 documents path in for loop C#
Thulasiram pakalaPosted Sep 25, 2024, 5:26 AM
string pattern = $"{identifier}_*.pdf"; $ { this is not working website 2010 version please any other wayin this string code
string pattern = $"{identifier}_*.pdf"
Thulasiram pakalaPosted Sep 25, 2024, 5:23 AM
$"{category}*.pdf"; this in 2017 version only no isuue but older web site this code showing error
string pattern = $"{identifier}_*.pdf";
string pattern1 = $"{identifier}_*.pdf";
string Gpfno = gpfno;
string[] laststrings = Directory.GetFiles(directoryPath, pattern1);
string[] files = Directory.GetFiles(directoryPath, pattern);
i am using this code this one working latest version but web site s its showing error
i try "${" +identifier+"}" "_*.pdf like also but this code not working any other way in this string pattern1 = $"{identifier}_*.pdf"; in websites
Abhishek YadavPosted Sep 25, 2024, 5:18 AM
To retrieve file paths from a folder structure in C# based on the provided category (like
Af_10008), you can use theSystem.IOnamespace to search through the folders and gather the paths of matching files. Below is an example demonstrating how to do this in a C# Windows Forms application.Example Code
This example will search through the specified folder structure (
GpfcontainingAf,Pol, etc.) and retrieve the paths of files matching a specific prefix.Explanation
SearchDocuments Method:
Af_10008*.pdf).DisplayFilePaths Method:
SearchButton_Click Event:
SearchDocumentsmethod with the specified base directory and category when a button is clicked.Additional Considerations