In a C# 2008 desktop application, I would like to come up with a test to see if the value 'CUST' is a valid directory level within a directory path supplied to the program. Basically the directory path would look like:
"C:\RData\CUST\Omaha\book.xlsx".
The code I am using the following code, but it is not working:
string filesaveLocation=ConfigurationSettings.AppSettings["Location"];
if (filesaveLocation == "*CUST*").
The value for filesaveLocation is obtained from the app.config file.
Thus can you show me how to change the code listed above, so that I can verify that 'CUST' is one of the directory folder names listed in a file path that looks like "C:\RData\CUST\Omaha\book.xlsx"?
I also have to test to see if the directory file path does not = 'CUST', in the directory path called ""C:\RData\CUST\Omaha\book.xlsx". Can you tell me how to code that change?
"C:\RData\CUST\Omaha\book.xlsx".
The code I am using the following code, but it is not working:
string filesaveLocation=ConfigurationSettings.AppSettings["Location"];
if (filesaveLocation == "*CUST*").
The value for filesaveLocation is obtained from the app.config file.
Thus can you show me how to change the code listed above, so that I can verify that 'CUST' is one of the directory folder names listed in a file path that looks like "C:\RData\CUST\Omaha\book.xlsx"?
I also have to test to see if the directory file path does not = 'CUST', in the directory path called ""C:\RData\CUST\Omaha\book.xlsx". Can you tell me how to code that change?
Last edited: