简体   繁体   English

有没有一种方法可以在C#WebAPI中执行javascript代码?

[英]Is there a way to execute javascript code in C# WebAPI?

From what I can research, executing server side usually uses node. 据我研究,执行服务器端通常使用节点。 However, my question is given a javascript file, is there a way to load it in C# and start calling function? 但是,我的问题是给一个javascript文件,有没有办法在C#中加载它并开始调用函数? Other options I'm looking at are AWS Lambda. 我正在查看的其他选项是AWS Lambda。

The impetus for this is I'm trying to use zxcvbn library but the C# implementation has a different result with the javascript. 这样做的动力是我试图使用zxcvbn库,但是C#实现与javascript有不同的结果。 So to make sure the two are in sync, the server side will be using the same code as the client side which is maintained by dropbox themselves. 因此,要确保两者同步,服务器端将使用与客户端相同的代码,这些代码由保管箱自己维护。

Thanks to @Dessus for the link, that is exactly what I wanted just didn't know the term for it. 感谢@Dessus提供的链接,这正是我想要的,只是不知道该术语。

Also, I found some implementation here which might help other. 另外,我在这里找到了一些可能对其他人有帮助的实现。

https://github.com/darcythomas/zxcvbn.net https://github.com/darcythomas/zxcvbn.net

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

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