简体   繁体   English

如何在 Node.js 服务器应用程序中运行 C#?

[英]How do I run C# within a Node.js server application?

I have a node.js application and a C# algorithm.我有一个 node.js 应用程序和一个 C# 算法。 The algorithm puts out 15 numbers that represent symbols on a digital slot machine.该算法在数字老虎机上输出 15 个代表符号的数字。 The node server is posting and getting data from Firebase and the digital slot machine is doing the same on the same table.节点服务器从 Firebase 发布和获取数据,数字老虎机也在同一张桌子上做同样的事情。

My question is how do I get the node server to run or get information from a C# algorithm?我的问题是如何让节点服务器运行或从 C# 算法中获取信息? Everything else is written in Javascript.其他一切都是用 Javascript 编写的。 Do I have to rewrite the algorithm in JS to integrate?我是否必须在 JS 中重写算法才能集成? I tried using a node module called edge.js but every time I tried to run my server there were compilation errors.我尝试使用名为 edge.js 的节点模块,但每次尝试运行我的服务器时都会出现编译错误。

Any help is greatly appreciated.任何帮助是极大的赞赏。

I have an solution for your problem .You can write an console app and then call it from nodejs.我有你的问题的解决方案。你可以编写一个控制台应用程序,然后从 nodejs 调用它。 Can look this url Execute an exe file using node.js .可以看这个 url 使用 node.js 执行一个 exe 文件 After the job writes all data to database, look to the table read from it via nodejs.作业将所有数据写入数据库后,查看通过 nodejs 从中读取的表。

EDIT: Your solution is a web service.编辑:您的解决方案是一个网络服务。 Kindly check WCF rest.请检查 WCF 休息。 Therefore, every request calls c# code from http protocol.因此,每个请求都会从 http 协议调用 c# 代码。 Then you can get the necessary data from the web service.然后,您可以从 Web 服务中获取必要的数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM