本文整理汇总了C#中InputBox.SetTextbox方法的典型用法代码示例。如果您正苦于以下问题:C# InputBox.SetTextbox方法的具体用法?C# InputBox.SetTextbox怎么用?C# InputBox.SetTextbox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InputBox
的用法示例。
在下文中一共展示了InputBox.SetTextbox方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: uploadToSiteButton_Click
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;
}