Home > Net >  How to use javascript to invoke the compiler c # class library DLL
How to use javascript to invoke the compiler c # class library DLL

Time:10-09

I now have a project to do a plug-in, plug-in first wrote a DLL is generated by the class library, then the plugin's main entrance is a js file, how to put the c # to run,,, in this plug-in,
If you have other solutions, such as web, or what can be put forward, thank you

CodePudding user response:

This is the app run locally?
If mainstream web side is made

CodePudding user response:

Write a winfrom nested inside your browser, so js can interact with c # code, I wrote a blog, you may have a look

CodePudding user response:

This is not desirable, you can use JS to access interface by means of XmlHttpRequest,

Can only be used if you have to call COM, the use of browser component or have a JS project library,

 https://docs.microsoft.com/zh-cn/dotnet/api/microsoft.jscript.globalobject? Redirectedfrom=MSDN& View=netframework 4.8 


Whether it is feasible to/

CodePudding user response:

If you do CS, so 2 # code is feasible... Browser controls inside the js is public method can call the background. Can return directly.

BS if you do, you can call in your code in the DLL's code and then the front desk with ajax to request..

Is actually a class library.. Like json.net you normally use this DLL.

CodePudding user response:

Made a COM + c # class library DLL project to Java calls,
Or browser component in c # (h5) encapsulates an exe shell call HTML page, c # and h5 interaction call each other (but to be honest it's not essential),
Don't know what is your project of language development?

CodePudding user response:

JS is front-end execution, is the server to perform DLL, JS can't directly executed on the server DLL
Only to write a new method or interface, call the DLL, and then use js request this interface, thereby to perform the method in a DLL

CodePudding user response:

Basically see you want to realize what function, some features can do with Blazor (of course this is normal function, special function browser for security reasons) don't let play
Introduction of blalzor
https://www.jianshu.com/p/8add0c628ff3

CodePudding user response:

The DLL released by service and then use js calls to just go

CodePudding user response:

Can use COM components, or put your written WebServices class library
  •  Tags:  
  • C#
  • Related