Click here to Skip to main content
15,881,044 members
Home / Discussions / C#
   

C#

 
QuestionC# in vb.net in windows base application Pin
Jinal Mistry6-Mar-13 19:30
Jinal Mistry6-Mar-13 19:30 
AnswerRe: C# in vb.net in windows base application Pin
Richard MacCutchan6-Mar-13 22:30
mveRichard MacCutchan6-Mar-13 22:30 
QuestionMonitoring Applications and Processes Pin
mphill47446-Mar-13 10:37
mphill47446-Mar-13 10:37 
AnswerRe: Monitoring Applications and Processes Pin
Jim Meadors6-Mar-13 19:49
Jim Meadors6-Mar-13 19:49 
AnswerRe: Monitoring Applications and Processes Pin
Bernhard Hiller6-Mar-13 23:24
Bernhard Hiller6-Mar-13 23:24 
GeneralRe: Monitoring Applications and Processes Pin
mphill47447-Mar-13 5:25
mphill47447-Mar-13 5:25 
AnswerRe: Monitoring Applications and Processes Pin
jschell7-Mar-13 8:40
jschell7-Mar-13 8:40 
Questionc# file directory structure change Pin
classy_dog6-Mar-13 10:19
classy_dog6-Mar-13 10:19 
In a C# 2008 desktop application I would like to know how to change the following code so that the files I am looking for can be located.
string Format_Date = DateTime.Now.AddMonths(-1).ToString("MM-yyyy");
    String filesaveLocation = null;
    filesaveLocation = Path.Combine(ConfigurationSettings.AppSettings["tLocation"], Format_Date);
    if (!Directory.Exists(filesaveLocation))
    {
        System.IO.Directory.CreateDirectory(filesaveLocation);
        logging.Error("The location " + filesaveLocation + " does not exist.");
        return packageId;
    }

   else
    {
       string[] RFiles = (from path in Directory.GetFiles(filesaveLocation)
                             let name = Path.GetFileName(path)
                             where name.EndsWith(".pdf") ||
                             name.EndsWith(".xlsx") ||
                             name.EndsWith(".xls")
                             select path).ToArray();

     }
        foreach (String RFile in RFiles)
      {
      }

The code was written for a directory path that looks like the following:
C:\Trans\01-2013 -Note the 01-2013 is for month and year.

Now I am finding out that the file directory stucture in production looks like the following:
R:\Trans\_JAN_2013\A-Sample. Under the A-Sample directory there are 4 separate subdirectories
called: SUB1, SUB2, SUB3, and SUB4.

I was expecting to see the files in one directory instead of 4 separate directories.

Thus can you show me code and/or tell me how you would change the code to accomodae the change in the file directory strucutre?
AnswerRe: c# file directory structure change Pin
Matt T Heffron6-Mar-13 12:42
professionalMatt T Heffron6-Mar-13 12:42 
GeneralRe: c# file directory structure change Pin
classy_dog6-Mar-13 18:50
classy_dog6-Mar-13 18:50 
GeneralRe: c# file directory structure change Pin
Matt T Heffron7-Mar-13 8:29
professionalMatt T Heffron7-Mar-13 8:29 
AnswerRe: c# file directory structure change Pin
Jegan Thiyagesan6-Mar-13 13:03
Jegan Thiyagesan6-Mar-13 13:03 
GeneralRe: c# file directory structure change Pin
classy_dog6-Mar-13 18:45
classy_dog6-Mar-13 18:45 
GeneralRe: c# file directory structure change Pin
Jegan Thiyagesan6-Mar-13 21:17
Jegan Thiyagesan6-Mar-13 21:17 
Questionpass Convert.ToDateTime to date in MysqlDataType Pin
Jassim Rahma6-Mar-13 2:21
Jassim Rahma6-Mar-13 2:21 
AnswerRe: pass Convert.ToDateTime to date in MysqlDataType Pin
Eddy Vluggen6-Mar-13 3:16
professionalEddy Vluggen6-Mar-13 3:16 
AnswerRe: pass Convert.ToDateTime to date in MysqlDataType Pin
OriginalGriff6-Mar-13 4:50
mveOriginalGriff6-Mar-13 4:50 
GeneralRe: pass Convert.ToDateTime to date in MysqlDataType Pin
Eddy Vluggen6-Mar-13 4:58
professionalEddy Vluggen6-Mar-13 4:58 
AnswerRe: pass Convert.ToDateTime to date in MysqlDataType Pin
Wayne Gaylard6-Mar-13 5:03
professionalWayne Gaylard6-Mar-13 5:03 
AnswerRe: pass Convert.ToDateTime to date in MysqlDataType Pin
jschell6-Mar-13 8:42
jschell6-Mar-13 8:42 
Questionplz check my sql code. is it correct ? Pin
Member 103026305-Mar-13 22:38
Member 103026305-Mar-13 22:38 
AnswerRe: plz check my sql code. is it correct ? Pin
Pete O'Hanlon5-Mar-13 22:41
mvePete O'Hanlon5-Mar-13 22:41 
GeneralRe: plz check my sql code. is it correct ? Pin
Member 103026305-Mar-13 23:43
Member 103026305-Mar-13 23:43 
GeneralRe: plz check my sql code. is it correct ? Pin
Pete O'Hanlon5-Mar-13 23:50
mvePete O'Hanlon5-Mar-13 23:50 
AnswerRe: plz check my sql code. is it correct ? Pin
PIEBALDconsult6-Mar-13 16:55
mvePIEBALDconsult6-Mar-13 16:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.