当前位置: 首页>>代码示例>>C#>>正文


C# InputBox.SetTextbox方法代码示例

本文整理汇总了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;
    }
开发者ID:vantruc,项目名称:skimpt,代码行数:84,代码来源:toastform.cs


注:本文中的InputBox.SetTextbox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。