简体   繁体   English

将数据从我的远程网站中的javascript函数传递到桌面应用程序上的ac#应用程序

[英]Passing data from a javascript function in my remote website to a c# application on my desktop application

I have a dynamic program. 我有一个动态程序。 These are the steps that the program follows. 这些是程序执行的步骤。

i) I have a windows form application and I have divided the window into two parts. 我)我有一个Windows窗体应用程序,我已将窗口分为两部分。 One part contains a ChromiumWebBrowser where it loads a remote website (like www.abc.com). 其中一部分包含ChromiumWebBrowser,可在其中加载远程网站(如www.abc.com)。 The other part does normal operations of fetching data from a wampserver MYSQL DATABASE installed on the local computer and gives output on the same window division. 另一部分执行正常操作,从本地计算机上安装的wampserver MYSQL DATABASE获取数据,并在同一窗口分区上提供输出。

ii) Now I use the Chromium web browser to import data from the remote website and send it to a local php file in the local wampserver and then inside the php file I send the data to appropriate local database tables. ii)现在,我使用Chromium Web浏览器从远程网站导入数据,并将其发送到本地wampserver中的本地php文件中,然后在php文件中,将数据发送到适当的本地数据库表中。

iii) When the remote website loads, there is a button "Import data" and then this importation is processed via an AJAX call and now it is in the ajax success: function(){ } that I send the data to my local php file. iii)加载远程网站时,有一个“导入数据”按钮,然后通过AJAX调用处理此导入,现在在ajax成功中:function(){},我将数据发送到本地php文件。 (I have control over both remote and local wampservers) (我可以控制远程和本地wampserver)

iv) NOW MY QUESTION IS how do I pass the data from the external javascript ajax to my c# application so that I don't need to have the local php file ie The received data will be sent to database directly from c# iv)现在我的问题是如何将数据从外部javascript ajax传递到我的C#应用​​程序,这样我就不需要本地php文件,即接收到的数据将直接从c#发送到数据库

v) And are there any security threats in the process? v)在此过程中是否存在任何安全威胁?

I hope I'm was clear, Any suggestions are welcome 希望我很清楚,欢迎任何建议

Easiest option is to implement a custom scheme . 最简单的选择是实现自定义scheme So for example you would make your requests to custom://ajax/uploadToDatabase . 因此,例如,您将向custom://ajax/uploadToDatabase发出请求。 You can then parse the request, update the database and respond accordingly. 然后,您可以解析请求,更新数据库并做出相应的响应。

http://rawgit.com/cefsharp/CefSharp/master/CefSharp.Example/Resources/Home.html#features-custom-schemes http://rawgit.com/cefsharp/CefSharp/master/CefSharp.Example/Resources/Home.html#features-custom-schemes

https://github.com/cefsharp/CefSharp/blob/cefsharp/45/CefSharp.Example/CefSharpSchemeHandler.cs#L51 https://github.com/cefsharp/CefSharp/blob/cefsharp/45/CefSharp.Example/CefSharpSchemeHandler.cs#L51

The CefSharp.WinForms.Example and CefSharp.Wpf.Example projects both provide a working implementation. CefSharp.WinForms.ExampleCefSharp.Wpf.Example项目均提供了有效的实现。 They're available on GitHub 它们在GitHubGitHub

https://github.com/cefsharp/CefSharp https://github.com/cefsharp/CefSharp

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

相关问题 需要从我的C#应用​​程序登录到网站 - Need to log in to a website from my C# application 如何将远程 web 主机上的 php 文件中的数据发送到我计算机上的 c# 应用程序? - how do i send data from a php file on a remote web host to a c# application on my computer? 将异步数据从网页传递到我的窗口形成C#.NET应用程序 - Passing asynchronous data from a web page to my window form C# .NET application 从C#桌面应用程序向远程服务器上的MySql数据库添加数据 - Adding of data to MySql database on remote server from C# desktop application 验证从桌面应用程序到我的网站的HTTP请求 - Authenticate HTTP requests from desktop application to my website C#以管理员身份运行远程桌面应用程序 - C# Run Remote Desktop Application as Administrator C#使用桌面应用程序自动登录网站 - C# autologin to website using desktop application 将数组值从 JavaScript 传递到我的 MVC C# 应用程序 - Pass array values from JavaScript to my MVC C# application C# 我的应用程序在任务管理器中启动但未显示在桌面中 - C# my application starts in task manager but not shown in Desktop 将图像和文本添加到我的测验应用程序(C#Desktop) - Add images and Text to my quiz application (C# Desktop)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM