Click here to Skip to main content
15,892,072 members
Home / Discussions / C#
   

C#

 
AnswerRe: hi Pin
Keith Barrow9-Dec-12 23:37
professionalKeith Barrow9-Dec-12 23:37 
Questionasp.net and c# login and register page Pin
Member 80648029-Dec-12 21:46
Member 80648029-Dec-12 21:46 
AnswerRe: asp.net and c# login and register page Pin
Vaibhav Kharejoshi9-Dec-12 22:35
Vaibhav Kharejoshi9-Dec-12 22:35 
Questionthe use of Lambda and action delegate Pin
Tridip Bhattacharjee9-Dec-12 21:17
professionalTridip Bhattacharjee9-Dec-12 21:17 
AnswerRe: the use of Lambda and action delegate Pin
Eddy Vluggen9-Dec-12 23:04
professionalEddy Vluggen9-Dec-12 23:04 
AnswerRe: the use of Lambda and action delegate Pin
Freak309-Dec-12 23:11
Freak309-Dec-12 23:11 
QuestionI thought understood file io Pin
David C# Hobbyist.9-Dec-12 10:10
professionalDavid C# Hobbyist.9-Dec-12 10:10 
AnswerRe: I thought understood file io Pin
Wendelius9-Dec-12 10:29
mentorWendelius9-Dec-12 10:29 
If I'm looking correctly, you try to open a StreamWriter to the same fileLocation you already have opened a StreamReader.

For example if the line variable is null, you don't close the reader since it's inside the if statement:
C#
...
                    if (line != null)
                    {
                        DateTime sd = DateTime.Parse( line );
                        if (dt >= sd.AddDays( 16 ))
                        {
                            sd = sd.AddDays( 30 );
                            StartDate.Text = sd.ToShortDateString();
                            EndDate.Text = sd.AddDays( 30 ).ToShortDateString();
                        }
                    readFile.Close(); // <-- This one
                    readFile = null;
                    }
                    else ...

You didn't explain the overall idea you're trying to accomplish so I'm not able to sae what would be a good correction to the code, but I encourage to use using[^] statement to ensure proper disposing etc.
AnswerRe: I thought understood file io Pin
Dave Kreskowiak9-Dec-12 12:23
mveDave Kreskowiak9-Dec-12 12:23 
AnswerRe: I thought understood file io Pin
Pete O'Hanlon9-Dec-12 18:20
mvePete O'Hanlon9-Dec-12 18:20 
QuestionWhat's the relation of delegate and threading Pin
mohammadkaab9-Dec-12 8:09
mohammadkaab9-Dec-12 8:09 
AnswerRe: What's the relation of delegate and threading Pin
Shameel10-Dec-12 21:19
professionalShameel10-Dec-12 21:19 
QuestionHow to pass variables from main window to Html file Pin
amiraf1239-Dec-12 3:43
amiraf1239-Dec-12 3:43 
AnswerRe: How to pass variables from main window to Html file Pin
Eddy Vluggen9-Dec-12 23:09
professionalEddy Vluggen9-Dec-12 23:09 
GeneralRe: How to pass variables from main window to Html file Pin
amiraf12310-Dec-12 0:51
amiraf12310-Dec-12 0:51 
GeneralRe: How to pass variables from main window to Html file Pin
Eddy Vluggen10-Dec-12 1:48
professionalEddy Vluggen10-Dec-12 1:48 
GeneralRe: How to pass variables from main window to Html file Pin
amiraf12310-Dec-12 2:36
amiraf12310-Dec-12 2:36 
GeneralRe: How to pass variables from main window to Html file Pin
Eddy Vluggen10-Dec-12 3:00
professionalEddy Vluggen10-Dec-12 3:00 
GeneralRe: How to pass variables from main window to Html file Pin
amiraf12310-Dec-12 3:36
amiraf12310-Dec-12 3:36 
GeneralRe: How to pass variables from main window to Html file Pin
Eddy Vluggen11-Dec-12 2:19
professionalEddy Vluggen11-Dec-12 2:19 
GeneralRe: How to pass variables from main window to Html file Pin
amiraf12311-Dec-12 3:56
amiraf12311-Dec-12 3:56 
QuestionWCF REST Service : Using Bing Map Pin
Vijay Kanda8-Dec-12 20:56
Vijay Kanda8-Dec-12 20:56 
AnswerRe: WCF REST Service : Using Bing Map Pin
OriginalGriff8-Dec-12 22:36
mveOriginalGriff8-Dec-12 22:36 
AnswerRe: WCF REST Service : Using Bing Map Pin
Richard MacCutchan8-Dec-12 22:40
mveRichard MacCutchan8-Dec-12 22:40 
GeneralRe: WCF REST Service : Using Bing Map Pin
Vijay Kanda9-Dec-12 10:33
Vijay Kanda9-Dec-12 10:33 

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.