Hello,
I am trying to create an app that will run on a internal remote server. The app 'listens' for XML files being generated by our BMS system and then processes these as required.
The next add on for the app, it is already running is to make use of the XML files above to create folders, share the folder with team members and then add in files for the team members to modify.
I use Visual Basic and have figuered out to create a folder which then appears in windows explorer. I have put a small delay after the folder creation so that enough time is given for the folder to sync back from dropbox.
I next want to share it with one of our team members which i assume i will do via thier email address.
So my code so far is,
Public Shared Sub Main(ByVal args As String())
Dim GetDetails = Threading.Tasks.Task.Run(CType(AddressOf ProcessingForm.GetID, Func(Of Threading.Tasks.Task)))
GetDetails.Wait()
End Sub
Private Shared Async Function GetID() As Task(Of Threading.Tasks.Task)
Using dbx = New DropboxClient("My Token")
Dim strFolder As String = "/TempFolder"
Dim full = Await dbx.Users.GetCurrentAccountAsync()
Console.WriteLine("{0} - {1}", full.Name.DisplayName, full.Email)
If Directory.Exists("C:\Users\Somesubfolder\" & strFolder) Then
' This path is a directory.
Else
Await dbx.Files.CreateFolderAsync(strFolder, False)
Thread.Sleep(1000)
End If
Await ListRootFolder(dbx)
End Using
End Function
Private Shared Async Function ListRootFolder(ByVal dbx As DropboxClient) As Threading.Tasks.Task
Dim list = Await dbx.Files.ListFolderAsync(String.Empty)
For Each item In list.Entries.Where(Function(i) i.IsFolder)
Console.WriteLine("D {0}/", item.Name)
Next
For Each item In list.Entries.Where(Function(i) i.IsFile)
Console.WriteLine("F{0,8} {1}", item.AsFile.Size, item.Name)
Next
End Function
Public Async Sub CreateANewFolder(ByVal token As String, ByVal path As String)
Using dbx = New DropboxClient(token)
Dim created = Await dbx.Files.CreateFolderAsync(path)
End Using
End Sub
I run 'Main' which checks I am a user, creates the folder if it does not exisit and then lists all the folders within my dropbox account.
Could someone point me in the direction of how to invite team members to this folder so they can edit the files it contains.
A code example would be very useful.
Many thanks.