using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Web; using System.Net; using System.IO; namespace UninstallSurvey { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { //lblHelpUs.Text = "Please help us improve our product by telling us why you chose to uninstall AyaNova. Your feedback is anonymous and will be kept strictly confidential."; edResponse.Text = "Your feedback is anonymous\r\n\r\nIf you would like a response please include your email address here\r\n\r\nThank you!"; } private void button1_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(edResponse.Text) || edResponse.ForeColor == SystemColors.GrayText) return; try { // Create a request using a URL that can receive a post. WebRequest request = WebRequest.Create("http://uisurvey.ayanova.com/uisurvey.aspx"); // Set the Method property of the request to POST. request.Method = "POST"; // Create POST data and convert it to a byte array. string postData = HttpUtility.UrlEncode("UNINSTALL SURVEY RESPONSE\r\n"+ edResponse.Text); byte[] byteArray = Encoding.UTF8.GetBytes(postData); // Set the ContentType property of the WebRequest. request.ContentType = "application/x-www-form-urlencoded"; // Set the ContentLength property of the WebRequest. request.ContentLength = byteArray.Length; // Get the request stream. Stream dataStream = request.GetRequestStream(); // Write the data to the request stream. dataStream.Write(byteArray, 0, byteArray.Length); // Close the Stream object. dataStream.Close(); // Get the response. WebResponse response = request.GetResponse(); // Display the status. Console.WriteLine(((HttpWebResponse)response).StatusDescription); // Get the stream containing content returned by the server. dataStream = response.GetResponseStream(); // Open the stream using a StreamReader for easy access. StreamReader reader = new StreamReader(dataStream); // Read the content. string responseFromServer = reader.ReadToEnd(); // Clean up the streams. reader.Close(); dataStream.Close(); response.Close(); } catch { } this.Close(); } private void edResponse_Enter(object sender, EventArgs e) { if (edResponse.ForeColor == SystemColors.GrayText) { edResponse.Text = ""; edResponse.ForeColor = SystemColors.WindowText; } } private void btnSkip_Click_1(object sender, EventArgs e) { this.Close(); } //---------------- } } /* This is the server page that accepts this response <%@ Page Language="C#" %> Survey processor form
Uninstall survey form




*/