How to call SS-generated DLLs in Nodejs

Source: Internet
Author: User
Tags json sleep thread tostring

To call SS-generated DLLs in Nodejs, you need to use Edgejs.

edgejs:http://tjanczuk.github.io/edge/

If you don't know how to build a DLL in SS, see: Spider Studio New Version (X-mas)-you can introduce a third-party assembly, you can create a script as a DLL

Here's an example of a xml/json-turn script that has been written (C # to solve the problem of json/xml interactions) to explain how to apply SS DLLs in Nodejs:

1. Install Edgejs

NPM Install Edge

2. Write a JavaScript proxy script for Www.utilities_online.info.XmlJsonConverter.dll

Altogether two methods, Xml2json & Json2xml:

var edge = require (' Edge ');
        Exports.xml2json = Edge.func ({source:function () {* * * using System.Threading;
        Using System.Threading.Tasks;
    
        Using Www.utilities_online.info;
                public class Startup {public async task<object> Invoke (object input) {
                object result = NULL; Thread t = new Thread (new Parameterizedthreadstart (p) => {using (var proxy = new Xmljsonconverter ()) {Proxy.
                        Init (); result = Proxy.
                    Xml2json (P.tostring ());
                }
                } ));
                T.setapartmentstate (ApartmentState.STA);
                T.isbackground = true;
                T.start (input);
                while (t.threadstate!= threadstate.stopped) {thread.sleep (100);
            return result;
   }
        } */}, references: [__dirname + ' \\www.utilities_online.info.XmlJsonConverter.dll ']});
        Exports.json2xml = Edge.func ({source:function () {* * * using System.Threading;
        Using System.Threading.Tasks;
    
        Using Www.utilities_online.info;
                public class Startup {public async task<object> Invoke (object input) {
                object result = NULL; Thread t = new Thread (new Parameterizedthreadstart (p) => {using (var proxy = new Xmljsonconverter ()) {Proxy.
                        Init (); result = Proxy.
                    Json2xml (P.tostring ());
                }
                } ));
                T.setapartmentstate (ApartmentState.STA);
                T.isbackground = true;
                T.start (input);
            while (t.threadstate!= threadstate.stopped) {thread.sleep (100);    return result; } */}, references: [__dirname + ' \\www.utilities_online.info.XmlJsonConverter.dll ']});

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.