SoapTime 构造函数

定义

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

重载

SoapTime()

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

SoapTime(DateTime)

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

SoapTime()

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

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

示例

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

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

适用于

SoapTime(DateTime)

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

public:
 SoapTime(DateTime value);
public SoapTime (DateTime value);
new System.Runtime.Remoting.Metadata.W3cXsd2001.SoapTime : DateTime -> System.Runtime.Remoting.Metadata.W3cXsd2001.SoapTime
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 SoapTime object.
SoapTime^ time = gcnew SoapTime( DateTime::Now );
Console::WriteLine( "The time is {0}.", time );
// Create a SoapTime object.
SoapTime time = new SoapTime(DateTime.Now);
Console.WriteLine("The time is {0}.", time.ToString());

适用于