In this article, we take a VB project as example.
1. Install SCM Anywhere Standalone Client on your machine. SCM Anywhere Standalone Windows Client comes with the COM SDK .
2. Please add 2 dll files, "SCMSSDK.dll" and "SCMS.Core.dll", to the project. In Visual Studio | Project | Add Reference | Browse tab, browse to the SCM Anywhere Standalone Client installation folder, highlight and select "SCMSSDK.dll" and "SCMS.Core.dll", and click OK.
3. You can use the ConnectToServer() function to connect to your SCM Anywhere Standalone Server, 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 sdkObject As New SCMSSDK()
Dim bobjTrial As New com.dynamsoft.scm.client.pub.common.basedataobjects.BoolObject
Dim iobjLeftTrialDays As New com.dynamsoft.scm.client.pub.common.basedataobjects.IntObject
Dim iobjLeftPasswordDays As New com.dynamsoft.scm.client.pub.common.basedataobjects.IntObject
Dim strobjError As New com.dynamsoft.scm.client.pub.common.basedataobjects.StringObject
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 System.Collections.Generic.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 = sdkObject.ConnectToServer("127.0.0.1", 7771, False, "admin", "", 0, "", 0, "", "", bobjTrial, iobjLeftTrialDays, iobjLeftPasswordDays, strobjError)
If ResultValue <> 0 Then
MsgBox("Failed to connect to server. " + strobjError.GetValue())
Else
MsgBox("Succeed in connecting to server.")
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'check out
listCheckoutServerFileFullName.Add("$/branch/1.txt")
listCheckoutLocalFileFullName.Add("D:\test\1.txt")
ResultValue = sdkObject.CheckoutFiles("Default", listCheckoutServerFileFullName, listCheckoutLocalFileFullName, "check out a file", False, 2, 0, 1, 2, stDiffMergeParameter, listItemOperateResults, strobjError)
If ResultValue <> 0 Then
MsgBox("Failed to check out. " + strobjError.GetValue())
Else
MsgBox("Succeed in checking out.")
End If
End Sub
End Class
