I always want to write some small programs in script language. I used to write them in HTML format, but every time I open them, I will have a security prompt. Today I suddenly found that if I save files in HTA format, the effect will be very different.
hey-hey. .
HTML is the abbreviation (HTML application) of HTML Application, a new concept of software development. It directly saves HTML into the format of HTA. It is an independent application software, which is no different from software designed by programming languages such as VB and C++.
Here is an example of an HTA:
The code is as follows:
<!—example1.hta-->
<html>
<head>
<title>Example of the first HTA</title>
<style>
p {font-size:24;cursor:hand}
</style>
</head>
<body>
<center>
<p>HTA</P>
<p>HTML Application</p>
<p>HTML Application</p>
</center>
</body>
</html>
Copy the above code to any text editor, save it as *.hta, and double-click it to see the effect.
HTA is similar to ordinary web page structure, so it is easy to design. Of course, HTA has many unique attributes:
1. HTA's syntax requirements are even looser than HTML, and even tags such as <html> and <body> can be omitted:
<!—example2.hta?
farewell
Wang Wei
I dismounted my horse and asked me where I could drink.
...
Note: The above is the entire code of the entire HTA file.
2. The appearance of HTA
You can use <HTA:Application> to set the appearance of the top HTA application, such as the title bar, border size, etc., and must be placed in <head>.
The code is as follows:
<!—example3.hta-->
<html>
<head>
<title>Example of the first HTA</title>
<HTA:Application
border="thick"
caption="yes"
maximizebutton="yes"
minimizebutton="yes"
sysmenu="yes"
windowstate="normal"
>
</head>
<body>
<center>
<p>HTA</P>
<p>HTML Application</p>
<p>HTML Application</p>
<button onclick="self.close()" style="font-size:18">Leave</button>
</center>
</body>
</html>
Description of some attributes:
border="thick" can be changed to "thin"
caption="yes" "no"
maximizebutton="yes" "no"
minimizebutton="yes" "no"
sysmenu="yes" "no"