Announcement

Collapse
No announcement yet.

Accessing API from .net

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

  • 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

  • #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


    • #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


      • #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

        Working...
        X