c# - Using Dropbox Generated Access Token with DropNetRT -


i'm using dropnetrt library , can't find way create working dropnetclient using generated access token app page in dropbox account.

if use user secret , user token works:

public static async task uploadstuff() {     dropnetclient client = new dropnetclient("apikey", "appsecret");     client.setusertoken(new userlogin() { secret = "mysecret", token = "mytoken" });     // upload data client } 

but, instead of usertoken , usersecret, want use generated access token.

it looks this, sure:

jfjfdkfkdfikaaaaaaaaaadkfkdjsjfjisjofdjfjjfojoidjsojsfkpfkpejkfjiksfd3_thd

now, tried using userlogin access token token , without usersecret, client threw exception, guess that's not right way that.

how can that? there way create client access token library, or have upload file manually using httpclient? if so, have no idea on how that.

thanks!

sergio

edit: tried (it's not working):

public static async task testuploadgeneratedtoken() {     // create client     dropnetclient client = new dropnetclient("apikey", "appsecret");     client.setusertoken("mygeneratedaccesstoken", string.empty);      // test file     storagefile tempfile = await applicationdata.current.temporaryfolder.createfileasync("test.txt", creationcollisionoption.openifexists);     await fileio.writetextasync(tempfile, "this simple test file");      // convert file byte array     irandomaccessstream stream = await tempfile.openasync(fileaccessmode.read);     stream.seek(0);     byte[] bytes = new byte[stream.size];     await stream.readasync(bytes.asbuffer(), (uint)stream.size, inputstreamoptions.none);      // upload file     await client.upload(crashreportpath, "tokentest.txt", bytes); } 

the upload method throws dropboxexception.

that looks right. try setting secret string.empty instead of null?

i'm not sure if have used generated token before can't see why wouldn't work.


Popular posts from this blog