Assembly : mscorlib (dans mscorlib.dll)
Syntaxe<SerializableAttribute> _ <ComVisibleAttribute(True)> _ Public Enumeration DayOfWeek
Dim instance As DayOfWeek
[SerializableAttribute] [ComVisibleAttribute(true)] public enum DayOfWeek
[SerializableAttribute] [ComVisibleAttribute(true)] public enum class DayOfWeek
/** @attribute SerializableAttribute() */ /** @attribute ComVisibleAttribute(true) */ public enum DayOfWeek
SerializableAttribute ComVisibleAttribute(true) public enum DayOfWeek
NotesL'énumération DayOfWeek représente le jour de la semaine dans les calendriers comptant sept jours par semaine. Cette énumération est comprise entre zéro (dimanche) et six (samedi).
Cette énumération est utile lorsqu'il est souhaitable d'avoir une spécification fortement typée du jour de la semaine. Par exemple, cette énumération représente le type de la valeur de la propriété DateTime.DayOfWeek.
ExempleL'exemple suivant illustre la propriété DateTime.DayOfWeek et l'énumération DayOfWeek.
' This example demonstrates the DateTime.DayOfWeek property Imports System Class Sample Public Shared Sub Main() ' Assume the current culture is en-US. ' Create a DateTime for the first of May, 2003. Dim dt As New DateTime(2003, 5, 1) Console.WriteLine("Is Thursday the day of the week for {0:d}?: {1}", _ dt, dt.DayOfWeek = DayOfWeek.Thursday) Console.WriteLine("The day of the week for {0:d} is {1}.", dt, dt.DayOfWeek) End Sub 'Main End Class 'Sample ' 'This example produces the following results: ' 'Is Thursday the day of the week for 5/1/2003?: True 'The day of the week for 5/1/2003 is Thursday. '
// This example demonstrates the DateTime.DayOfWeek property using System; class Sample { public static void Main() { // Assume the current culture is en-US. // Create a DateTime for the first of May, 2003. DateTime dt = new DateTime(2003, 5, 1); Console.WriteLine("Is Thursday the day of the week for {0:d}?: {1}", dt, dt.DayOfWeek == DayOfWeek.Thursday); Console.WriteLine("The day of the week for {0:d} is {1}.", dt, dt.DayOfWeek); } } /* This example produces the following results: Is Thursday the day of the week for 5/1/2003?: True The day of the week for 5/1/2003 is Thursday. */
// This example demonstrates the DateTime.DayOfWeek property using namespace System; int main() { // Assume the current culture is en-US. // Create a DateTime for the first of May, 2003. DateTime dt = DateTime(2003,5,1); Console::WriteLine( "Is Thursday the day of the week for {0:d}?: {1}", dt, dt.DayOfWeek == DayOfWeek::Thursday ); Console::WriteLine( "The day of the week for {0:d} is {1}.", dt, dt.DayOfWeek ); } /* This example produces the following results: Is Thursday the day of the week for 5/1/2003?: True The day of the week for 5/1/2003 is Thursday. */
// This example demonstrates the DateTime.DayOfWeek property import System.*; class Sample { public static void main(String[] args) { // Assume the current culture is en-US. // Create a DateTime for the first of May, 2003. DateTime dt = new DateTime(2003, 5, 1); Console.WriteLine("Is Thursday the day of the week for {0:d}?: {1}", dt, (System.Boolean)(dt.get_DayOfWeek() == DayOfWeek.Thursday)); Console.WriteLine("The day of the week for {0:d} is {1}.", dt, dt.get_DayOfWeek()); } //main } //Sample /* This example produces the following results: Is Thursday the day of the week for 5/1/2003?: True The day of the week for 5/1/2003 is Thursday. */
Plates-formesWindows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile pour Pocket PC, Windows Mobile pour Smartphone, Windows Server 2003, Windows XP Édition Media Center, Windows XP Professionnel Édition x64, Windows XP SP2, Windows XP Starter Edition
Le .NET Framework ne prend pas en charge toutes les versions de chaque plate-forme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise.

Outils (masquer)
S'enregistrer
Liste des Membres
Qui est en ligne?
FAQ