Click here to Skip to main content
11,484,402 members (65,882 online)
Click here to Skip to main content
Add your own
alternative version

Simple Upload File to Rapidshare Account Method using C#

, 2 Apr 2009 GPL3 55.9K 796 32
By using this C# (.NET 2.0) method, you can easily upload your files to Rapidshare.com account
QUploadToRapidshare.zip
bin
Debug
QUploadToRapidshare.exe
QUploadToRapidshare.vshost.exe
Properties
Settings.settings
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 Heyrani Nobari
Software Developer (Senior)
Iran (Islamic Republic Of) Iran (Islamic Republic Of)
Ghasem - Heyrani-Nobari
Qasem*AT*SQNco.com

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150520.1 | Last Updated 2 Apr 2009
Article Copyright 2009 by Ghasem Heyrani Nobari
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid