Lua - Accessing files & controlling applications?

前端 未结 2 1099
无人及你
无人及你 2021-01-06 13:03

How would a person use the Lua scripting language to do things such as this:

Opening an application such as IE and controlling it, accessing the C drive and the curr

相关标签:
2条回答
  • 2021-01-06 13:52

    Generally speaking, Lua doesn't have this kind of stuff built-in. Lua is a minimalist programming language, great for embedding. The core language only uses facilities available in C89. If you want bells and whistles, you need to add Lua libraries.

    You can find libraries by searching the wiki, at luarocks, luadist, or luaforge

    For "controlling IE" you should take a look at LuaCom

    For accessing the current directory, try LuaFileSystem

    0 讨论(0)
  • 2021-01-06 14:03

    I'll add to Doug's correct answer the observation that you might be better off not attempting to control IE if the actual goal is just to fetch web pages at the whim of a script. For that, a library like cURL is a much better choice, and there is a binding to it for Lua known as luacurl.

    That binding, along with all of the bindings mentioned by Doug are available as part of the Lua for Windows distribution. Reading between the lines, you are most concerned about the Windows platform, so that distribution should be your starting point.

    If you plan to integrate Lua with C# and other .NET languages, then you will want to investigate LuaInterface as well.

    0 讨论(0)
提交回复
热议问题