简体   繁体   English

如何从Web JavaScript应用程序获取桌面C#程序中的变量

[英]how to get variable in desktop c# program from web javascript application

I met a problem that there are two applications. 我遇到了两个应用程序的问题。 one is desktop application in c#, and another is web application in javascript. 一个是C#中的桌面应用程序,另一个是javascript中的Web应用程序。 some variables or informations in running desktop application are needed to transfer to web application. 需要一些正在运行的桌面应用程序中的变量或信息才能传输到Web应用程序。 Does any one know how to solve this? 有谁知道如何解决这个问题? Does any one would like to provide more details to solve this? 是否有人想提供更多细节来解决这个问题?

Regards, 问候,

当您打开Web应用程序时,将变量作为查询字符串参数传入,您可以使用javascript各种方式来获取它们,其中一些在此处进行了说明

I think the processes are very well separated and unless you use a sole handler for c# + js (c#.net to render your page for instance) it is going to be impossible to retrieve data. 我认为这些过程是完全分开的,除非您为c#+ js使用单独的处理程序(例如,c#.net来呈现您的页面),否则将无法检索数据。

Maybe you can get something from the webbrowser object: running it on your page you might gain access to some of your web variables... 也许您可以从webbrowser对象中得到一些东西:在页面上运行它,您可能会访问某些Web变量...

Also, if the c# app writes data in a file, the js could read it... 另外,如果c#应用程序将数据写入文件中,则js可以读取它...

Have fun Rgds 玩得开心Rgds

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

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