How to check out a file using SCM Anywhere Hosted SDK?

In this article, we take a VB project as example.

1. Install SCM Anywhere Hosted Client on your machine. SCM Anywhere Hosted Windows Client comes with the COM SDK .

2. Please add the following 2 dll files, "SCMHSDK.dll" and "SCMH.Core.dll", to the project. In Visual Studio, click menu Project | Add Reference | Browse, browse to the SCM Anywhere Hosted Client installation folder, highlight and select "SCMHSDK.dll" and "SCMH.Core.dll", and click OK.

3. You can use the ConnectToServer() function to connect to your SCM Anywhere Hosted account, and then use the CheckoutFiles() function to check out the files.

Here is a sample in VB:
Imports com.dynamsoft.scm.SCMSDK

Public Class Form1
    Dim sdkObj As New SCMHSDK()
    Dim bobjTrial As New
    Dim iobjLeftTrialDays As New
    Dim iobjLeftPasswordDays As New
    Dim strobjError As New
    Dim ResultValue As Long

    Dim listCheckoutServerFileFullName As New List(Of String)
    Dim listCheckoutLocalFileFullName As New List(Of String)
    Dim stDiffMergeParameter As New com.dynamsoft.scm.SCMSDK.Framework.SDKDiffMergeParameter
    Dim listItemOperateResults As New List(Of com.dynamsoft.scm.SCMSDK.Framework.SDKItemOperatorResult)

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        'connect to server
        ResultValue = sdkObj.ConnectToServer(100000, False, "admin", "password", 0, "", 0, "", "", bobjTrial, iobjLeftTrialDays, iobjLeftPasswordDays, strobjError)
        If ResultValue <> 0 Then
        End If

        'check out files

        ResultValue = sdkObj.CheckoutFiles("Default", listCheckoutServerFileFullName, listCheckoutLocalFileFullName, "", False, 3, 0, 1, 3, stDiffMergeParameter, listItemOperateResults, strobjError)
        If ResultValue <> 0 Then
        End If

    End Sub
End Class

Is this page helpful?

Leave a Reply

Your email address will not be published.