Accessing API from .net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arnoutellis

    Accessing API from .net

    I'm working on a SQL tool in .net where I want to compare 2 long strings in Beyond Compare. I want a web interface where the user can select 2 SQL scripts to compare, which will then automatically open beyond compare and the two scripts are open and differences are shown.
    In my function I have 2 strings that contain the text I want to compare.

    Is is possible for me to call beyond compare from my function and compare these two strings?
    Alternatively, I could save the strings to 2 separate temporary files. Can I target beyond compare at these two files and open beyond compare showing the file comparison?
    Any help or suggestions on how to set this up and access Beyond Compare API or something along these lines would be great.
    Thanks
    Arnout
  • Aaron
    Team Scooter
    • Oct 2007
    • 16000

    #2
    Hello,

    We do not offer a graphical web interface, but Beyond Compare 3 can generate HTML reports you could return to your users. Launch BC3 with the graphical interface and load up two of your Temp files. Then generate a Text Compare report from the Session menu of the Text Compare, and pick amongst the various reports and report options available. If any of these meet your needs then we can automate that solution.

    Beyond Compare 3 can run script with variables passed in the command line. So Bcompare.exe @myScript.txt tempfile1.txt tempfile2.txt

    myScript.txt would contain instructions to generate a Text-Compare report. Script can refer to tempfile1.txt as %1 and the 2nd parameter as %2. You can find sample scripts in the Help file under Using Beyond Compare -> Automating with Script: Sample Scripts. Script Reference is available at the Top level of the Help file.

    I would recommend testing script from your own command line to see if it is functioning as you expect before attempting to implement into the server environment.

    Let us know if you have any questions.
    Aaron P Scooter Software

    Comment

    • silverio_rdza
      New User
      • Jan 2011
      • 1

      #3
      It will be difficult to execute beyond compare from an IIS server

      I'm trying to execute BCompare.exe in silent mode using an @Script.txt file to run the coparison in script mode.

      IIS is not allowing me to execute beyond compare executable (well no only beyond compare) but it seems IIS worker process does not allow to execute any executable.

      Is there a BCompare DLL that I can use in my C# code behind in order to do a folder comparison using my @script file?

      What I did is to create a C# CGI configured in my IIS then I can execute the CGI and then Beyond compare can be executed, but the thing is this is a big hole in my website security, since I need to pass the folders as a query string to the CGI and a malicious user can do something bad to my website using that hole.

      Comment

      • Chris
        Team Scooter
        • Oct 2007
        • 5538

        #4
        Hi Silverio,

        We don't have a DLL version of Beyond Compare 3. It you want to use Beyond Compare 3, your only option is to automate it with command line scripting.

        If you don't have very complex diff needs, you might also consider just looking for an open source diff library, a few possibilities are listed here: http://stackoverflow.com/questions/6...are-algorithms
        Last edited by Chris; 03-May-2022, 09:37 AM. Reason: Removed BCDiffer/DLL information as Scooter Software no longer sells a DLL product.
        Chris K Scooter Software

        Comment

        • Amit kumar sharma
          New User
          • Dec 2023
          • 1

          #5
          Hi, Does beyond compare provides any api that would help us in comparing files by integrating that api into our own tool ?

          Comment

          • Aaron
            Team Scooter
            • Oct 2007
            • 16000

            #6
            Hello,

            Most automation is handled with scripting, which can be called from the command line to perform specific actions like report generation or synchronization. Beyond Compare also has a /quickcompare command line, for file comparisons (not folder level), with error levels documented in the Help file -> Command Line Reference.

            BC4 also has an 'External Format', which allows the user to define another program as a file viewer, similar to our built-in Text Compare, Table Compare, Picture Compare, etc, as long as the program respects certain return values to latch into our rules-based scanning, etc.
            Aaron P Scooter Software

            Comment

            Working...