Click here to Skip to main content
16,007,126 members
Home / Discussions / C#
   

C#

 
QuestionDate Time Synchronize Pin
Rahul.RK31-Jul-06 23:20
Rahul.RK31-Jul-06 23:20 
AnswerRe: Date Time Synchronize Pin
stancrm31-Jul-06 23:28
stancrm31-Jul-06 23:28 
AnswerRe: Date Time Synchronize Pin
J4amieC1-Aug-06 0:03
J4amieC1-Aug-06 0:03 
QuestionWindows Media Player ActiveX Aspect-Ratio Pin
Souhail Jabbour31-Jul-06 23:06
Souhail Jabbour31-Jul-06 23:06 
QuestionString containing date value Pin
WinBond31-Jul-06 22:48
WinBond31-Jul-06 22:48 
AnswerRe: String containing date value Pin
WinBond31-Jul-06 23:01
WinBond31-Jul-06 23:01 
AnswerRe: String containing date value Pin
Guffa31-Jul-06 23:10
Guffa31-Jul-06 23:10 
AnswerRe: String containing date value Pin
stancrm31-Jul-06 23:19
stancrm31-Jul-06 23:19 
static bool IsDateTimeOk(string input)
{
	try
	{
		int year = int.Parse(input.Substring(0, 2)) + 2000;
		int month = int.Parse(input.Substring(2, 2));
		int day = int.Parse(input.Substring(4, 2));
		int maxDaysInFeb = 28;

		if(year % 4 == 0 && year % 100 != 0 && year % 400 == 0)
			maxDaysInFeb = 29;

		if(month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 ||	month == 12)
			if(day >= 1 && day <= 31)
				return true;
			else if(month != 2)
				if(day >= 1 && day <= 30)
					return true;
				else
					if(day >= 1 && day <= maxDaysInFeb)
					return true;

		return false;
	}
	catch
	{
		return false;
	}
}

GeneralRe: String containing date value Pin
WinBond1-Aug-06 21:09
WinBond1-Aug-06 21:09 
QuestionSimple forms question Pin
SoftcodeSoftware31-Jul-06 22:39
SoftcodeSoftware31-Jul-06 22:39 
AnswerRe: Simple forms question Pin
rah_sin31-Jul-06 22:41
professionalrah_sin31-Jul-06 22:41 
GeneralRe: Simple forms question Pin
SoftcodeSoftware31-Jul-06 22:45
SoftcodeSoftware31-Jul-06 22:45 
QuestionHow to open tabpage when 'click mouse-right' button? Pin
maaran31-Jul-06 22:27
maaran31-Jul-06 22:27 
Questionusing params problem Pin
impeham31-Jul-06 22:21
impeham31-Jul-06 22:21 
AnswerRe: using params problem Pin
J4amieC31-Jul-06 22:27
J4amieC31-Jul-06 22:27 
GeneralRe: using params problem Pin
impeham31-Jul-06 22:55
impeham31-Jul-06 22:55 
Questiondatagrid with dataview Pin
Mohammed Elkholy31-Jul-06 21:50
Mohammed Elkholy31-Jul-06 21:50 
AnswerRe: datagrid with dataview Pin
rah_sin31-Jul-06 22:32
professionalrah_sin31-Jul-06 22:32 
GeneralRe: datagrid with dataview Pin
Mohammed Elkholy1-Aug-06 5:27
Mohammed Elkholy1-Aug-06 5:27 
Questioncode standards Pin
NasimKaziS31-Jul-06 21:32
NasimKaziS31-Jul-06 21:32 
AnswerRe: code standards Pin
Michael P Butler31-Jul-06 21:53
Michael P Butler31-Jul-06 21:53 
GeneralRe: code standards Pin
NasimKaziS1-Aug-06 2:51
NasimKaziS1-Aug-06 2:51 
QuestionC# Printing Pin
Mugombi31-Jul-06 21:18
Mugombi31-Jul-06 21:18 
AnswerRe: C# Printing Pin
L Viljoen1-Aug-06 2:10
professionalL Viljoen1-Aug-06 2:10 
Questioninterop.excel Pin
AnnnS31-Jul-06 21:02
AnnnS31-Jul-06 21:02 

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.