private void uploadToSiteButton_Click(object sender, EventArgs e) { this.lifeTimer.Enabled = false; //declare the form. MultipartForm form; //define the inputbox as readonly, output only. InputBox i = new InputBox("Your URL", "Your URL is also copied to the clipboard automatically", false, true); uploadToSiteButton.Enabled = false; uploadToFtpButton.Enabled = false; applyEffectButton.Enabled = false; string returnValue; //see what option they chose. switch (hostingChoicesComboBox.SelectedItem.ToString().ToLower()) { case "kalleload.net": form = new MultipartForm("http://www.kalleload.net/"); form.FileContentType = "image/jpeg"; form.InputBoxName = "selector"; form.setField("progress", "1"); form.setField("markurl", String.Empty); form.setField("MAX_UPLOAD_SIZE", "16777216"); form.sendFile(_FileNameToHandle); returnValue = utilities.parsePOSTData("kalleload", form.ResponseText.ToString()); Clipboard.SetText(returnValue, TextDataFormat.Text); i.SetTextbox(returnValue); i.Show(); break; //case "imgpurse.com": // form = new MultipartForm("http://www.imgpurse.com/"); // form.FileContentType = "image/jpeg"; // form.InputBoxName = "file"; // form.setField("upload", "1"); // form.sendFile(_FileNameToHandle); // returnValue = utilities.parsePOSTData("imgpurse", form.ResponseText.ToString()); // Clipboard.SetText(returnValue, TextDataFormat.Text); // i.SetTextbox(returnValue); // i.Show(); // break; case "tinypic.com": form = new MultipartForm("http://s4.tinypic.com/upload.php"); form.FileContentType = "image/jpeg"; form.InputBoxName = "the_file"; form.setField("UPLOAD_IDENTIFIER", "1154009790_1225587842"); form.setField("upk", "e8bd19dfda564c710e602341ed9ffdec"); form.setField("action", "upload"); form.sendFile(_FileNameToHandle); returnValue = utilities.parsePOSTData("tinypic", form.ResponseText.ToString()); Clipboard.SetText(returnValue, TextDataFormat.Text); i.SetTextbox(returnValue); i.Show(); break; case "imageshack.us": form = new MultipartForm("http://www.imageshack.us"); form.FileContentType = "image/jpeg"; form.InputBoxName = "fileupload"; form.setField("swfbutan", "1"); form.sendFile(_FileNameToHandle); returnValue = utilities.parsePOSTData("imageshack", form.ResponseText.ToString()); Clipboard.SetText(returnValue, TextDataFormat.Text); i.SetTextbox(returnValue); i.Show(); break; case "imgcow.com": form = new MultipartForm("http://www.imgcow.com/index.php"); form.FileContentType = "image/jpeg"; form.InputBoxName = "file_1"; form.sendFile(_FileNameToHandle); returnValue = utilities.parsePOSTData("imgcow", form.ResponseText.ToString()); Clipboard.SetText(returnValue, TextDataFormat.Text); i.SetTextbox(returnValue); i.Show(); break; default: break; } this.lifeTimer.Enabled = true; this.applyEffectButton.Enabled = true; this.uploadToSiteButton.Enabled = true; this.uploadToFtpButton.Enabled = true; //get rid of the form. form = null; }
private void uploadToSiteButton_Click(object sender, EventArgs e) { this.lifeTimer.Enabled = false; //declare the form. MultipartForm form; //define the inputbox as readonly, output only. InputBox i = new InputBox("Your URL", "Your URL is also copied to the clipboard automatically", false, true); uploadToSiteButton.Enabled = false; uploadToFtpButton.Enabled = false; applyEffectButton.Enabled = false; string returnValue; //see what option they chose. switch(hostingChoicesComboBox.SelectedItem.ToString().ToLower()) { case "kalleload.net": form = new MultipartForm("http://www.kalleload.net/"); form.FileContentType = "image/jpeg"; form.InputBoxName = "selector"; form.setField("progress", "1"); form.setField("markurl", String.Empty); form.setField("MAX_UPLOAD_SIZE", "16777216"); form.sendFile(_FileNameToHandle); returnValue = utilities.parsePOSTData("kalleload", form.ResponseText.ToString()); Clipboard.SetText(returnValue, TextDataFormat.Text); i.SetTextbox(returnValue); i.Show(); break; //case "imgpurse.com": // form = new MultipartForm("http://www.imgpurse.com/"); // form.FileContentType = "image/jpeg"; // form.InputBoxName = "file"; // form.setField("upload", "1"); // form.sendFile(_FileNameToHandle); // returnValue = utilities.parsePOSTData("imgpurse", form.ResponseText.ToString()); // Clipboard.SetText(returnValue, TextDataFormat.Text); // i.SetTextbox(returnValue); // i.Show(); // break; case "tinypic.com": form = new MultipartForm("http://s4.tinypic.com/upload.php"); form.FileContentType = "image/jpeg"; form.InputBoxName = "the_file"; form.setField("UPLOAD_IDENTIFIER", "1154009790_1225587842"); form.setField("upk", "e8bd19dfda564c710e602341ed9ffdec"); form.setField("action", "upload"); form.sendFile(_FileNameToHandle); returnValue = utilities.parsePOSTData("tinypic", form.ResponseText.ToString()); Clipboard.SetText(returnValue, TextDataFormat.Text); i.SetTextbox(returnValue); i.Show(); break; case "imageshack.us": form = new MultipartForm("http://www.imageshack.us"); form.FileContentType = "image/jpeg"; form.InputBoxName = "fileupload"; form.setField("swfbutan", "1"); form.sendFile(_FileNameToHandle); returnValue = utilities.parsePOSTData("imageshack", form.ResponseText.ToString()); Clipboard.SetText(returnValue, TextDataFormat.Text); i.SetTextbox(returnValue); i.Show(); break; case "imgcow.com": form = new MultipartForm("http://www.imgcow.com/index.php"); form.FileContentType = "image/jpeg"; form.InputBoxName = "file_1"; form.sendFile(_FileNameToHandle); returnValue = utilities.parsePOSTData("imgcow", form.ResponseText.ToString()); Clipboard.SetText(returnValue, TextDataFormat.Text); i.SetTextbox(returnValue); i.Show(); break; default: break; } this.lifeTimer.Enabled = true; this.applyEffectButton.Enabled = true; this.uploadToSiteButton.Enabled = true; this.uploadToFtpButton.Enabled = true; //get rid of the form. form = null; }