Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to remove null value from Lambda expression or Array Pin
kevinnicol11-Jun-12 10:04
kevinnicol11-Jun-12 10:04 
GeneralRe: How to remove null value from Lambda expression or Array Pin
Member 871482911-Jun-12 10:48
Member 871482911-Jun-12 10:48 
GeneralRe: How to remove null value from Lambda expression or Array Pin
Pete O'Hanlon11-Jun-12 12:05
mvePete O'Hanlon11-Jun-12 12:05 
QuestionC# 2010 edit Pin
sc steinhayse11-Jun-12 6:58
sc steinhayse11-Jun-12 6:58 
AnswerRe: C# 2010 edit Pin
Dave Kreskowiak11-Jun-12 7:12
mveDave Kreskowiak11-Jun-12 7:12 
AnswerRe: C# 2010 edit Pin
OriginalGriff11-Jun-12 8:31
mveOriginalGriff11-Jun-12 8:31 
QuestionDesign surface inside other design surface Pin
redhatee200611-Jun-12 3:42
redhatee200611-Jun-12 3:42 
QuestionAm I doing this right..... Pin
glennPattonWork311-Jun-12 2:41
professionalglennPattonWork311-Jun-12 2:41 
Hi All,
I am writing an application and need to save some data with an incremental number.
My first thought was to use an integer that be could incremented and shoved out disk, now I am trying to do thing properly so I have come up with the following
C#
String Path = Directory.GetCurrentDirectory();
            string[] file_text = Directory.GetFiles(@Path, "*.txt");
            string Name;
            int FileTotal = 0;
                       
            for (int i = 0; i <= file_text.Length - 1; i++)
            {             
               Name = file_text[i].Substring(Path.Length+1);
              // MessageBox.Show(Name);
               FileTotal++;
              // MessageBox.Show(FileTotal.ToString());
            }


            MessageBox.Show(FileTotal.ToString());
            FileTotal++;

            MessageBox.Show("Next File to Written is " + FileTotal.ToString());

It looks for the file (in the bit of example code .txt ...) adds one to the total for the next one. Is this the 'correct' way of doing things or am I creating a kludge that will come back and bite me later.

Glenn
AnswerRe: Am I doing this right..... Pin
PIEBALDconsult11-Jun-12 3:20
mvePIEBALDconsult11-Jun-12 3:20 
GeneralRe: Am I doing this right..... Pin
glennPattonWork311-Jun-12 3:31
professionalglennPattonWork311-Jun-12 3:31 
GeneralRe: Am I doing this right..... Pin
PIEBALDconsult11-Jun-12 4:12
mvePIEBALDconsult11-Jun-12 4:12 
GeneralRe: Am I doing this right..... Pin
glennPattonWork311-Jun-12 4:23
professionalglennPattonWork311-Jun-12 4:23 
AnswerMessage Removed Pin
11-Jun-12 3:45
professionalN_tro_P11-Jun-12 3:45 
GeneralRe: Am I doing this right..... Pin
glennPattonWork311-Jun-12 3:49
professionalglennPattonWork311-Jun-12 3:49 
GeneralMessage Removed Pin
11-Jun-12 4:18
professionalN_tro_P11-Jun-12 4:18 
GeneralRe: Am I doing this right..... Pin
glennPattonWork311-Jun-12 4:29
professionalglennPattonWork311-Jun-12 4:29 
GeneralMessage Removed Pin
11-Jun-12 4:33
professionalN_tro_P11-Jun-12 4:33 
GeneralRe: Am I doing this right..... Pin
glennPattonWork311-Jun-12 4:36
professionalglennPattonWork311-Jun-12 4:36 
GeneralMessage Removed Pin
11-Jun-12 4:38
professionalN_tro_P11-Jun-12 4:38 
GeneralRe: Am I doing this right..... Pin
glennPattonWork311-Jun-12 4:40
professionalglennPattonWork311-Jun-12 4:40 
AnswerRe: Am I doing this right..... Pin
BobJanova11-Jun-12 5:56
BobJanova11-Jun-12 5:56 
GeneralRe: Am I doing this right..... Pin
glennPattonWork311-Jun-12 6:00
professionalglennPattonWork311-Jun-12 6:00 
Questionping from Windows-Mobile in C# Pin
goldsoft10-Jun-12 22:30
goldsoft10-Jun-12 22:30 
AnswerRe: ping from Windows-Mobile in C# Pin
Pete O'Hanlon10-Jun-12 22:42
mvePete O'Hanlon10-Jun-12 22:42 
QuestionTaking voice input in C# in Visual Studio Pin
Namus Adhikari10-Jun-12 20:40
Namus Adhikari10-Jun-12 20:40 

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.