SoapMonth 构造函数

定义

初始化 SoapMonth 类的新实例。Initializes a new instance of the SoapMonth class.

重载

SoapMonth()

初始化 SoapMonth 类的新实例。Initializes a new instance of the SoapMonth class.

SoapMonth(DateTime)

用指定的 SoapMonth 对象初始化 DateTime 类的新实例。Initializes a new instance of the SoapMonth class with a specified DateTime object.

SoapMonth()

初始化 SoapMonth 类的新实例。Initializes a new instance of the SoapMonth class.

public:
 SoapMonth();
public SoapMonth ();
Public Sub New ()

示例

下面的代码示例演示如何使用此构造函数。The following code example shows how to use this constructor.

// Create a SoapMonth object.
SoapMonth^ month = gcnew SoapMonth;
month->Value = DateTime::Now;
Console::WriteLine( "The month is {0}.", month );
// Create a SoapMonth object.
SoapMonth month = new SoapMonth();
month.Value = DateTime.Now;
Console.WriteLine("The month is {0}.", month.ToString());

适用于

SoapMonth(DateTime)

用指定的 SoapMonth 对象初始化 DateTime 类的新实例。Initializes a new instance of the SoapMonth class with a specified DateTime object.

public:
 SoapMonth(DateTime value);
public SoapMonth (DateTime value);
new System.Runtime.Remoting.Metadata.W3cXsd2001.SoapMonth : DateTime -> System.Runtime.Remoting.Metadata.W3cXsd2001.SoapMonth
Public Sub New (value As DateTime)

参数

value
DateTime

用于初始化当前实例的 DateTime 对象。A DateTime object to initialize the current instance.

示例

下面的代码示例演示如何使用此构造函数。The following code example shows how to use this constructor.

// Create a SoapMonth object.
SoapMonth^ month = gcnew SoapMonth( DateTime::Now );
Console::WriteLine( "The month is {0}.", month );
// Create a SoapMonth object.
SoapMonth month = new SoapMonth(DateTime.Now);
Console.WriteLine("The month is {0}.", month.ToString());

适用于