Click here to Skip to main content
12,692,105 members (32,569 online)
Click here to Skip to main content

Stats

62.9K views
864 downloads
32 bookmarked
Posted

Simple Upload File to Rapidshare Account Method using C#

, 2 Apr 2009 GPL3
By using this C# (.NET 2.0) method, you can easily upload your files to Rapidshare.com account
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.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

Share

About the Author

Ghasem Nobari
Team Leader
Iran (Islamic Republic of) Iran (Islamic Republic of)
Ghasem - Nobari
Qasem*AT*SQNco.com

You may also be interested in...

Pro
Pro
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170118.1 | Last Updated 2 Apr 2009
Article Copyright 2009 by Ghasem Nobari
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid