开发者

JavaScript HTA development on Windows. Can I use sockets?

开发者 https://www.devze.com 2023-01-15 05:24 出处:网络
I\'开发者_JS百科m trying to use sockets to connect to a server through HTA scripting. Is this possible? There\'s isn\'t much information on the web, some examples would be greatly appreciated.There is

I'开发者_JS百科m trying to use sockets to connect to a server through HTA scripting. Is this possible? There's isn't much information on the web, some examples would be greatly appreciated.


There is no socket access built into JScript, but you can use any of the installed ActiveX components.

I guess there are some 3rd party ones that provide raw socket access, but there are none in vanilla Windows installations. This means you'd not only have to distribute the HTA, but also install an ActiveX component, which would make deployment rather cumbersome.

If you can, use HTTP as a way to access remote resources, and use the built-in XmlHttpRequest or WinHttpRequest objects that comes with Windows.

0

精彩评论

暂无评论...
验证码 换一张
取 消