/// <summary> /// This part sends the argument to the server and also gives you the option to select /// what you want to do. If it's update or lookup. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { if (lacationform2.UpdateButton == true) { // the if statement below checks if the debugging features is ticked // if that is tick i want to send the arguement to the main program and making debug true // if the debug isn't ticked, the debug becomes the default which is false string[] argsfromwindowsform = { "-h", m_servername, "-p", m_portnumber, "-t", m_timeout, m_protocol, m_username, m_location }; Whois.Main(argsfromwindowsform); textBox1.Text = Whois.response; if (checkBox1.Checked) { textBox1.Text = textBox1.Text + "\r\n" + "Debug Feature enabled" + "\r\n" + Whois.debuggingresponse; } } // this method is to send the arguements to the main program if the it's a lookup // Also when the debug features is ticked, the debug becomes true and false by default when the server is not tick else { //Whois.clientInfo.Add(tb_username.Text); string[] argsfromwindowsform = { "-h", m_servername, "-p", m_portnumber, "-t", m_timeout, m_protocol, m_username }; Whois.Main(argsfromwindowsform); textBox1.Text = Whois.response; // if the check box is clicked, enable the debug response. if (checkBox1.Checked) { textBox1.Text = textBox1.Text + "\r\n" + "Debug Feature enabled" + "\r\n" + Whois.debuggingresponse; } } }
private void sendButton_Click(object sender, EventArgs e) { //These aray gonna contain all the value need to sent to location.cs to process it string[] myargs = { "-h", serverNameInput, "-p", portNumberInput, "-t", timeoutInput, debug, protocolInput, userNameInput, locationInput }; Whois.Main(myargs); //this send the array of value to the location.cs to WHois protocol if (debugCheckBox.Checked) //When debugging options is ticked { respomseTextBox.Text = Whois.response + "\r\n" + Whois.debugResponse; //Print response with debug response } else { respomseTextBox.Text = Whois.response;//The server output } }