Skip to content
jamesheck2019 edited this page Oct 15, 2019 · 8 revisions

FembedSDK

Download:https://github.com/jamesheck2019/FembedSDK/releases
NuGet: NuGet

Features

  • Assemblies for .NET 4.5.2 and .NET Standard 2.0 and .NET Core 2.1
  • Just one external reference (Newtonsoft.Json)
  • Easy installation using NuGet
  • Upload/Download tracking support
  • Proxy Support
  • Upload/Download cancellation support

Functions

  • DownloadFile
  • DownloadFileAsStream
  • GetDirectUrl
  • ImportToYourAccount
  • ListFolder
  • ListRemoteUpload
  • MultiRemoteUpload
  • RemoteUpload
  • RemoteUploadStatus
  • SetVideoThumbnail_Local
  • SetVideoThumbnail_Remote
  • UploadLocalFile
  • UserInfo
  • YoutubeRemoteUpload

Example:

    Sub SetClient()
        Dim MyClient As FlipDriveSDK.IClient = New FlipDriveSDK.FClient("user", "pass")
    End Sub
    Sub SetClientWithOptions()
        Dim Optians As New FlipDriveSDK.ConnectionSettings With {.CloseConnection = True, .TimeOut = TimeSpan.FromMinutes(30), .Proxy = New FlipDriveSDK.ProxyConfig With {.ProxyIP = "172.0.0.0", .ProxyPort = 80, .ProxyUsername = "myname", .ProxyPassword = "myPass", .SetProxy = True}}
        Dim MyClient As FlipDriveSDK.IClient = New FlipDriveSDK.FClient("tkn.apiUrl", "tkn.authorizationToken", Optians)
    End Sub
    Async Sub ListFilesAndFolders()
        Dim result = Await MyClient.List("folder id / root=null", FilterEnum.all, SortEnum.Name, 500)
        For Each vid In result.data.items
            DataGridView1.Rows.Add(vid.name, vid.ID, vid.link, vid.size)
        Next
    End Sub
    Async Sub DeleteFileOrFolder()
        Dim result = Await MyClient.Delete(New List(Of String) From {"file or folder id"})
    End Sub
    Async Sub MoveFileOrFolder()
        Dim result = Await MyClient.Move(New List(Of String) From {"file or folder id"}, "folder id")
    End Sub
    Async Sub CreateNewFolder()
        Dim result = Await MyClient.CreateNewFolder("parent folder id", "new folder name")
    End Sub
    Async Sub RenameFileOrFolder()
        Dim result = Await MyClient.Rename("file or folder id id", "new name")
    End Sub
    Async Sub Search()
        Dim result = Await MyClient.Search("keyword", FilterEnum.all, SortEnum.Name, 600)
    End Sub
    Async Sub Upload_Local_WithProgressTracking()
        Dim UploadCancellationToken As New Threading.CancellationTokenSource()
        Dim _ReportCls As New Progress(Of FlipDriveSDK.ReportStatus)(Sub(ReportClass As FlipDriveSDK.ReportStatus)
                                                                         Label1.Text = String.Format("{0}/{1}", (ReportClass.BytesTransferred), (ReportClass.TotalBytes))
                                                                         ProgressBar1.Value = CInt(ReportClass.ProgressPercentage)
                                                                         Label2.Text = CStr(ReportClass.TextStatus)
                                                                     End Sub)
        Await MyClient.Upload("J:\DB\myvideo.mp4", UploadTypes.FilePath, "folder id", "myvideo.mp4", _ReportCls, UploadCancellationToken.Token)
    End Sub
    Async Sub Download_File_WithProgressTracking()
        Dim DownloadCancellationToken As New Threading.CancellationTokenSource()
        Dim _ReportCls As New Progress(Of FlipDriveSDK.ReportStatus)(Sub(ReportClass As FlipDriveSDK.ReportStatus)
                                                                         Label1.Text = String.Format("{0}/{1}", (ReportClass.BytesTransferred), (ReportClass.TotalBytes))
                                                                         ProgressBar1.Value = CInt(ReportClass.ProgressPercentage)
                                                                         Label2.Text = CStr(ReportClass.TextStatus)
                                                                     End Sub)
        Await MyClient.Download("file id", "J:\DB\", "myvideo.mp4", _ReportCls, DownloadCancellationToken.Token)
    End Sub
    Async Sub AddFileToFavorite()
        Dim result = Await MyClient.AddToFavorite(New List(Of String) From {"file/folder id"})
    End Sub
    Async Sub RemoveFileFromFavorite()
        Dim result = Await MyClient.RemoveFromFavorite(New List(Of String) From {"file/folder id"})
    End Sub
    Async Sub ListFavorites()
        Dim result = Await MyClient.ListFavorites(FilterEnum.all, SortEnum.Name, 200)
        For Each vid In result.data.items
            DataGridView1.Rows.Add(vid.name, vid.ID, vid.link, vid.size)
        Next
    End Sub

Clone this wiki locally