Click here to Skip to main content
15,860,972 members
Home / Discussions / C#
   

C#

 
QuestionVariable for number of days Pin
Member 1447460716-Nov-20 5:56
Member 1447460716-Nov-20 5:56 
SuggestionRe: Variable for number of days Pin
Richard MacCutchan16-Nov-20 6:01
mveRichard MacCutchan16-Nov-20 6:01 
AnswerRe: Variable for number of days Pin
Gerry Schmitz16-Nov-20 6:58
mveGerry Schmitz16-Nov-20 6:58 
GeneralRe: Variable for number of days Pin
Richard Deeming16-Nov-20 21:41
mveRichard Deeming16-Nov-20 21:41 
GeneralRe: Variable for number of days Pin
Gerry Schmitz17-Nov-20 4:57
mveGerry Schmitz17-Nov-20 4:57 
GeneralRe: Variable for number of days Pin
Richard Deeming17-Nov-20 17:35
mveRichard Deeming17-Nov-20 17:35 
GeneralRe: Variable for number of days Pin
Gerry Schmitz17-Nov-20 20:52
mveGerry Schmitz17-Nov-20 20:52 
AnswerRe: Variable for number of days Pin
Richard Deeming16-Nov-20 21:43
mveRichard Deeming16-Nov-20 21:43 
C#
int completedDays;
int.TryParse(ConfigurationManager.AppSettings["CompletedDays"], out completedDays);
return DateTime.Today.AddDays(completedDays).ToString("yyyy-MM-dd");
Int32.TryParse Method (System) | Microsoft Docs[^]

If the setting isn't a valid integer, completedDays will be set to 0. If you want to validate that the setting is valid, check the return value of TryParse.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Variable for number of days Pin
pkfox18-Nov-20 21:11
professionalpkfox18-Nov-20 21:11 
QuestionChanging the properties of multiple labels in some kind of loop? Pin
Ron_UK16-Nov-20 4:55
Ron_UK16-Nov-20 4:55 
AnswerRe: Changing the properties of multiple labels in some kind of loop? Pin
Pete O'Hanlon16-Nov-20 5:00
subeditorPete O'Hanlon16-Nov-20 5:00 
GeneralRe: Changing the properties of multiple labels in some kind of loop? Pin
Ron_UK16-Nov-20 5:17
Ron_UK16-Nov-20 5:17 
AnswerRe: Changing the properties of multiple labels in some kind of loop? Pin
OriginalGriff16-Nov-20 5:06
mveOriginalGriff16-Nov-20 5:06 
GeneralRe: Changing the properties of multiple labels in some kind of loop? Pin
Ralf Meier16-Nov-20 5:16
professionalRalf Meier16-Nov-20 5:16 
GeneralRe: Changing the properties of multiple labels in some kind of loop? Pin
OriginalGriff16-Nov-20 5:27
mveOriginalGriff16-Nov-20 5:27 
GeneralRe: Changing the properties of multiple labels in some kind of loop? Pin
Ron_UK16-Nov-20 5:36
Ron_UK16-Nov-20 5:36 
GeneralRe: Changing the properties of multiple labels in some kind of loop? Pin
OriginalGriff16-Nov-20 5:48
mveOriginalGriff16-Nov-20 5:48 
GeneralRe: Changing the properties of multiple labels in some kind of loop? Pin
Ron_UK16-Nov-20 5:58
Ron_UK16-Nov-20 5:58 
GeneralRe: Changing the properties of multiple labels in some kind of loop? Pin
Ron_UK16-Nov-20 5:19
Ron_UK16-Nov-20 5:19 
GeneralRe: Changing the properties of multiple labels in some kind of loop? Pin
OriginalGriff16-Nov-20 5:27
mveOriginalGriff16-Nov-20 5:27 
GeneralRe: Changing the properties of multiple labels in some kind of loop? Pin
Ron_UK16-Nov-20 8:39
Ron_UK16-Nov-20 8:39 
GeneralRe: Changing the properties of multiple labels in some kind of loop? Pin
OriginalGriff16-Nov-20 9:29
mveOriginalGriff16-Nov-20 9:29 
AnswerRe: Changing the properties of multiple labels in some kind of loop? Pin
Luc Pattyn16-Nov-20 5:30
sitebuilderLuc Pattyn16-Nov-20 5:30 
GeneralRe: Changing the properties of multiple labels in some kind of loop? Pin
Ron_UK16-Nov-20 5:40
Ron_UK16-Nov-20 5:40 
AnswerRe: Changing the properties of multiple labels in some kind of loop? Pin
Gerry Schmitz16-Nov-20 7:13
mveGerry Schmitz16-Nov-20 7:13 

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.