The leading provider of version control solution and TWAIN SDK

How to check out a file using SourceAnywhere Hosted COM SDK?

In this article, we take a C# Project as example.

1.  Install SourceAnywhere Hosted COM SDK on your machine.

2.  Add “SAWHSDK.dll” to the project. In Visual Studio, click menu Project | Add Reference | Browse, browse to the installation folder of SourceAnywhere Hosted COM SDK, select “SAWHSDK.dll” and click OK.

3.  You can use ConnectToServer() to connect to SourceAnywhere Hosted Server and use Login() to log into your account and then use CheckoutFiles() to check out a file.

Here is a sample in C#:

private void btnConnect_Click(object sender, EventArgs e)

        {

           

           long ResultValue;

           Enum_EncryptType EncryptType;

            SAWHGlobalMessageSet GlobalMessageSet;

            string PlanName;

            bool Cancelled;

            string ResultDescription;

 

           ResultValue = SAWH.ConnectToServer(181915, false, false, "", 0, Enum_ProxyType.Enum_NOPROXY, "", 0, "", "", out EncryptType,out GlobalMessageSet,out PlanName,out Cancelled,out ResultDescription);

           if (ResultValue == 0)

           {

               bool MustChangePassword;

               int DaysOfExpiration;

               bool Cancelled1;

               string ResultDescription1;

 

               SAWH.Login("dynamsoft", "sawh", "default", out MustChangePassword, out DaysOfExpiration, out Cancelled1, out ResultDescription1);

               MessageBox.Show(ResultDescription1);

              

           }

        }

 

        private void btnCheckOut_Click(object sender, EventArgs e)

        {

            long ResultValue;           

            SAWHDiffMergeParam MergeParam = new SAWHDiffMergeParam();

            bool Cancelled;

            String ResultDescription;

            SAWHOperationResultSet OperationResultSet;

            SAWHCheckoutFileSet CheckoutFileSet = new SAWHCheckoutFileSet();

            SAWHCheckoutFile CheckoutFile = new SAWHCheckoutFile();

 

            CheckoutFile.FileToCheckout = "$/posts.doc";

            CheckoutFile.LocalFileName = "D:\\temp\\posts.doc";

            CheckoutFileSet.Add(CheckoutFile);

 

            ResultValue = SAWH.CheckoutFiles(CheckoutFileSet, false, "", false, Enum_ModifiedFileHandling.Enum_AskModifiedFile, Enum_EOL.Enum_EOLWindowsCRLF, Enum_CompareFileBy.Enum_CompareFileByChecksum, Enum_SetLocalFileTime.Enum_SetLocalFileTimeModification, MergeParam, out Cancelled, out ResultDescription, out OperationResultSet);

            MessageBox.Show(ResultDescription);

        }




Article Details

Last Updated
28th o September, 2010

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF

User Opinions (0 votes)

No users have voted.

How would you rate this answer?



Thank you for rating this answer.

Related Articles

No related articles were found.

Attachments

No attachments were found.

Visitor Comments

No visitor comments posted. Post a comment

Post a comment

To post a comment for this article, simply complete the form below. Fields marked with an asterisk are required.
   Name:
   Email:
* Comment:
* Enter the code below:
 

Continue