With SocketWrench added to the project, the next step is to design the form. In this example, it'll be a simple application with a single form that has four Label controls, five TextBox controls and a Button control. TextBox1 will be used to specify the host name of the web server to connect to. TextBox2 will be used to specify the port number. TextBox3 will be used to specify a timeout period. TextBox4 will be used to specify the name of the file to retrieve from the server and display. TextBox5 will be used as a multi-line textbox to display the data retrieved from the server. The actual design should look similar to this:
With this form, the TextBox controls have already been initialized with the default values that will be used in the example. The web server will be www.catalyst.com with the connection being established on port 80 (the default port for web servers) with a timeout period of 20 seconds. The file to retrieve from the server will be the default index page, which is designated as "/".