在C#windows窗体应用程序中使用AJAX [英] To use AJAX in C# windows form application

查看:118
本文介绍了在C#windows窗体应用程序中使用AJAX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在C#windows窗体应用程序中使用AJAX。

Is it possible To use AJAX in C# windows form application.

推荐答案

问题似乎没有任何意义,这不是关于可能性或缺乏可能性。 Ajax一词与Javascript无关,而是其他内容: http://en.wikipedia.org/wiki/Ajax [< a href =http://en.wikipedia.org/wiki/Ajaxtarget =_ blanktitle =New Window> ^ ]。



如果你以某种方式在你的 System.Windows.Forms 应用程序中托管了一些Javascript解释器和运行时系统,问题会有所帮助,但是很难相信:如果你工作的话在那种复杂程度上,很明显你可以使用Javascript提供的所有东西,包括Ajax,所以你不会问这样的问题。



相反,我怀疑您需要向某个站点或Web服务发送HTTP请求并接收HTTP响应。但这可以使用类 System.Net.HttpWebRequest 来完成:

http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest%28v=vs.110 %29.aspx [ ^ ],

http://msdn.microsoft.com/en-us/library/system.net.webrequest(v = vs.110).aspx [ ^ ]。



当然这与 System.Windows.Forms 或任何其他UI框架/库完全无关或任何特定的申请类型。



-SA
The question does not seem to make any sense, and this is not about possibility or lack of possibility. The term Ajax is related to Javascript and nothing else: http://en.wikipedia.org/wiki/Ajax[^].

The question would make some sense if you somehow hosted some Javascript interpreter and runtime system in your System.Windows.Forms application, but it's hard to believe: if you worked at that level of sophistication, it would be apparent for you that you could use everything Javascript offers, including Ajax, so you would not ask such a question.

Rather, I suspect that you need to send an HTTP request to some site or Web service and receive HTTP response. But this can be done using the class System.Net.HttpWebRequest:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.net.webrequest(v=vs.110).aspx[^].

And of course this is totally unrelated to System.Windows.Forms or any other UI framework/library or any particular application type.

—SA


这篇关于在C#windows窗体应用程序中使用AJAX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆