|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace QUploadToRapidshare
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private string FilePath;
private void button1_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
}
private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
FilePath = openFileDialog1.FileName;
textBox1.Text = FilePath;
}
private void button2_Click(object sender, EventArgs e)
{
if (textBox1.Text == "") openFileDialog1.ShowDialog();
button2.Enabled = false;
button2.Text = "Please Wait...";
backgroundWorker1.RunWorkerAsync();
}
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
QRapidshare QRapid = new QRapidshare();
int type = 0;//Free User
if (radioButton1.Checked)
{
type = 1;//Premium User
}
else if (radioButton2.Checked)
{
type = 2;//Collector User
}
string result = QRapid.QUploadToRapidshare(FilePath, textBox2.Text, textBox3.Text, type);
if (result.StartsWith("<!")) result = "Login failed!";
e.Result = result;
}
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
richTextBox1.Text = e.Result.ToString();
button2.Enabled = true;
button2.Text = "Upload";
}
private void textBox1_DoubleClick(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.