VB .NET DropBox Api Source Code Example

VB .NET DropBox Api Example

Create a Desktop Application using VB .NET and Dropbox Api

VB .NET Dropbox Api Example
VB .NET Dropbox Api Example


Requirements

Visual Basic 2010 [recommended VS 2015] or above (Visual Studio 2019) from here
Visual Basic previous Example from here
Dropbox Account from here
.NET Framework 4.0 or above for above VS versions.
Dropbox Api for current .NET Framework version of yours

Open VB 2015 Project in VB 2019


Can I open / migrate Visual Basic 2015 Project Source Code with Visual Basic 2019 ?
The answer is Yes, if you want to more details about VB 2015 to VB 2019 migration, please read

Project description

I will use the VB.NET example from previous post to add a functionality to it. I will add Backup Database to Dropbox [ToolStripMenuItem]
VB.NET Dropbox Database file Backup

When a user press [ToolStripMenuItem -> Backup to Dropbox] : The VB.NET application does the following :
  • Checks for Internet Connection Status.
  • Connects to Dropbox Application created in Dropbox developer section [App Console].
  • Uploads the Microsoft Access 2007 (*.accdb) Database file from previous post to [Backups] folder created by me using Dropbox Api [UploadFileAsync].
  • Returns a string [Uploaded_File_Name] to verify [UploadFileAsync] method.

Installing Dropbox Api from Visual Studio 2015

To install latest Dropbox Api for .NET from Visual Basic 2015 :


  • Navigate to (https://www.nuget.org/packages/Dropbox.Api/) to obtain the latest Dropbox Api version
  • Copy the PM code (PM> Install-Package Dropbox.Api -Version 4.9.4)
  • Open Visual Basic 2015 as Administration
  • Choose NuGet package manager -> Package manage console
VB .NET Dropbox Api installation using NuGet in VS2015
VB .NET Dropbox Api installation using NuGet in VS2015


  • In the console manager in Visual Studio, paste the PM Code and press


VB .NET Dropbox Api installation using NuGet from VS 2015
VB .NET Dropbox Api installation using NuGet from VS 2015


  • Wait for Dropbox Api download to 100% complete and restart Visual Studio 2015, you will get Successfully installed 'Dropbox.Api 4.9.4' to [HierarchicalTreeView]
  • Now, in your Visual Basic 2015 Solution Explorer panel [References] would looks something like this :
vb.net-dropbox-api-integration-step-by-step
vb.net-dropbox-api-integration-step-by-step

Create Dropbox Account for developer and create [Backups] folder.

  • Open and login to your Dropbox account and choose [Files], then [New Folder], name it [Backups]


Dropbox create folder
Dropbox create folder
Dropbox create folder
Dropbox create folder


  • From the lowest right corner of the webpage choose developer


Dropbox create developer account
Dropbox create developer account
  • Choose [Create apps], then finish the application settings as follows
dropbox-create-application
dropbox-create-application
  • Press button [Create app], you will be navigated to Dropbox application settings page
dropbox-create-application-settings
dropbox-create-application-settings

Extending the Visual Basic 2015 Project from previous post [Hierarchical TreeView]

If you wish to change the targeted .NET Framework for your application , for example (If you installed Dropbox Api package for .NET Framework 4.5 using NuGet and you changed the .Net Framework from 4.5 to 4.6.1) You will receive an error message like this :

Error

vb.net-dropbox-api-integration-reinstall
vb.net-dropbox-api-integration-reinstall

severity code description project project rank file line category source suppression state error Some NuGet packages were installed using a target framework different from the current target framework and may need to be reinstalled. Visit http://docs.nuget.org/docs/workflows/reinstalling-packages for more information. Packages affected: Dropbox.Api, Microsoft.Bcl, Microsoft.Net.Http, Newtonsoft.Json HierarchicalTreeView 1 0 Build

    Solution

    • From Tools -> NuGet Package Manager -> Package Manager Console
    • PM> update-package -reinstall
    • Press , wait for the update process to finish 100%.
    • From [Build] -> [Clear] then [Build]
    • In any case you get a warning like this :

    Error [Warning]

    severity code description project project rank file line category source suppression state warning found conflicts between different versions of the same dependent assembly. please set the "autogeneratebindingredirects" property to true in the project file. for more information, see http://go.microsoft.com/fwlink/?linkid=294190. hierarchicaltreeview 1 build

    Solution for <autogeneratebindingredirects> in VS 2015

    Remove all duplicate references from Solution explorer


    • Now, from Build [rebuild] your project.

    Source Code updates for VB.NET Dropbox in my example

    • VB .NET Function to check for internet connection status
    • Dropbox Api .NET functionalities to connect to Dropbox application and Dropbox Folder.
    • Dropbox Api .Net functionality to upload files from local machine to remote directory.
    • Dropbox Api .Net Code to get Upload File Status.
    • Fix for Microsoft Access Record-Locking Information (*.laccdb) While Compact and Repair and Backup to Dropbox.
    • You will find all the packages you need installed in the [/Packages] folder in the Source Code, I only removed the Jist files.
    • The VB .NET Source Code is 21 MB, because of the [/Packages] folder.
    VB .NET Dropbox Api FileUpload Source Code Example
    VB .NET Dropbox Api File-Upload Source Code Example

    VB .NET Dropbox Source Code Example Download (Sept, 2019)

    Password : projectzone.co


    VB .NET Dropbox Api upload large files 'Post Update October, 2019'

    Password projectzone.co

    Link to this article :



    Here are some online Visual Basic lessons and courses :

    Popular posts from this blog

    VB .NET Google Drive Api Source Code Example

    VB .NET WebView2 WinForms tips

    Visual Basic Online Courses DataGridView Add Edit Delete

    Visual Basic Online Course DevExpress 12.2.4 full for Visual Studio 2010

    Visual Basic 2010 Working With DataBase Full Project Example