1
Vote

No auth method found.

description

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HigLabo.Net;
using HigLabo.Net.Dropbox;
using System.IO;
using System.Text;


namespace DropBoxTest
{
public partial class Default : System.Web.UI.Page
{
    private const string App_key = "67ea7hdwcadsc0b";
    private const string App_secret = "g0te4kcd1jqxog1";
    string RequestToken, Token, TokenSecret;
    string RequestTokenSecret;
    protected void Page_Load(object sender, EventArgs e)
    {




    }

    protected void btnSubmit_Click(object sender, EventArgs e)
    {


        OAuthClient ocl = null;
        AuthorizeInfo ai = null;
        ocl = DropboxClient.CreateOAuthClient(App_key,App_secret);
        ai = ocl.GetAuthorizeInfo();
         RequestToken = ai.RequestToken;
         RequestTokenSecret = ai.RequestTokenSecret;
        string redirect_url = ai.AuthorizeUrl;
        AccessTokenInfo t = ocl.GetAccessToken(RequestToken, RequestTokenSecret);

         Token = t.Token;
         TokenSecret = t.TokenSecret;



        string path = "/databaseBackup/DeeCoup.bak";

        DeleteFile(path);

    }

    public void DeleteFile(string file)
    {
        DropboxClient cl = new DropboxClient(App_key, App_secret, Token, TokenSecret);

        HigLabo.Net.Dropbox.DeleteCommand delcom = new HigLabo.Net.Dropbox.DeleteCommand();
        delcom.Root = RootFolder.Dropbox;
        delcom.Path = file;

        Metadata md = cl.Delete(delcom);
    }

}
}

comments