<h4>How Do I...Make a DateTime client with TCPClient?</h4>
<div class="indent" style="width:660"></div>
<P>
This sample illustrates using the TCPClient class to create a DateTime program.
</p><P>
This application acts as a client for the standard Date and Time protocol. This protocol works on port 13, and responds to any TCP connections to that port with the current date and time.
</P>
<P>
The application firsts creates a <B>TCPClient</B> object with the default constructor. Next, the hostname that was specified at the command line is resolved into an IP address with the statis class <B>DNS</B>. Next, the <B>Connect</B> method is called and the TCPClient connects to the server on port 13.
</P>
<P>
The <B>GetStream</B> method is next called and a <B>Stream</B> object is returned that represents the data returned by the server. This data is read from the <B>Stream</B> object with the read method, and the byte array that the read function returns is turned into a string, and displayed.