简体   繁体   English

如何从 JavaScript 通信到文件系统

[英]How to communicate from JavaScript to filesystem

I am making a Windows application in Visual Studio 2010 by embeding a webbrowser object loading a local file.我正在通过嵌入加载本地文件的 webbrowser 对象在 Visual Studio 2010 中制作 Windows 应用程序。

Now I want the web page to read and write from and to the filesystem from JavaScript.现在我希望网页从 JavaScript 读取和写入文件系统。

I have done the same in a HTA just calling simple VBS functions for read and write files.我在 HTA 中做了同样的事情,只是调用简单的 VBS 函数来读取和写入文件。

How do I do in .NET 4.0?在 .NET 4.0 中我该怎么做?

You can fill data using provided methods.您可以使用提供的方法填充数据。

webBrowser1.Document.GetElementById("myTextbox").SetAttribute("value") = "my_value" ;

and it is also possible to Invoke javascript functions as well.也可以Invoke javascript 函数。 So that is how you can do it.所以这就是你可以做到的。

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

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