终于空下一段时间,可以学一些新东西,看了一下有关asp+的相关资料,觉得很值得学一下,所以就一边学习一边写下这个教程,对于自己来说,可以作为学习笔记,对于别人, Especially those who are not very good E can be used as a readable Chinese material, and play a role of attracting bricks. Due to the limited level, errors are inevitable. I hope everyone can criticize and correct it. First of all, I will talk about what is ASP+, and then I will combine the example of NGWS's own example. Because more C is usually used, all examples are written in C#(C Sharp, a new programming language of Microsoft, which corresponds to its NGWS Runtime).
Since it is called ASP+ tutorial, it is natural to say what ASP+ is, but here I don't want to simply translate Microsoft's own introduction. One is because there are many such translation articles, and Microsoft itself has a little self -touted. I just want to talk about some preliminary impression of ASP+. The first feeling given by ASP+to me is that the function is too powerful. Maybe you have seen the ASP+program of my domain name query, which is much more convenient than using components. Traditional programming languages can be done, ASP+can be done, of course, because it is a web programming language itself, it is still limited by Web programming. So, what are the breakthroughs in ASP for ASP? First of all, the operating mechanism is different. ASP is an interpreted programming framework. Its core is VBS and JS. Due to the limitations of these two script languages, it determines that ASP is inherently inadequate. So if you need to perform some components such as Socket, files, etc., you have to use other traditional programming languages such as C ++, VB, Java, etc., and because it is explained and executed, it is greatly reduced in operating efficiency. And ASP+, it is a compiled programming framework. Its core is NGWS Runtime. In addition to VBS and JS as a programming language like ASP, it can also be written in VB and C#, which determines its functional function Powerful, you can perform many low -level operations without the help of other programming languages. In addition, because it runs after compilation, the execution efficiency is much higher than ASP.
Alas, the things that talk about these theoreticals are really boring and boring. Let's be a little practical. Let me talk about the operating environment of ASP+. If you want to run ASP+programs, first of all, you have to have running conditions (nonsense). First of all, you need the ASP+support environment, that is, NGWS Runtime. You can download it from the Microsoft site for free. Since NGWS is planned to be officially produced in Visual Studio7 Version, so what you can download now is its Beta version, the specific version number is 1812.9. But don't rush to download, first look at whether your machine can run, the specific requirements are as follows:
· CPU: Intel Pentium II-CLASS 300 MHz (Intel Pentium III-Class 600 MHz RECOMMEDED)
· RAM: 96 MB (128 MB Recommended)
· Available Hard Disk Space (for Install): 250 MB
· Available Hard Disk Space (Post Install): 155 MB
· Video: 800X600, 256 Colors
· CD-ROM: Required
· Operating System: Microsoft Windows 2000 and Microsoft Internet Explorer 5.5
· Other Software: MDAC 2.6 Beta 2
Look at it, how about, if your computer meets the requirements, let's come, let's download this more than 80 m behemoth. The specific download address is:
http://download.microsoft.com/download/platformsdk/trial/1812.10full/nt5/en-setup.exe
After downloading, the installation and configuration are very simple. You only need to run this setup.exe and then complete the installation according to the guide. Now we can run our first ASP+program. Okay, look at the following program:
file: intro1.aspx
<html>
<head>
<link rel = styleSheethref = intro.css>
</head>
<body>
<Center>
<FORM ACTION = Intro1.aspx Method = Post>
<h3> name: <input ID = name type = text>
category: <select id = category size = 1>
<option> psychology </option>
<option> Business </option>
<option> Popul_comp </option>
</select>
<input type = submit value = lookup>
</form>
</center>
</body>
</html>
How about it, let's understand. What? Is this a standard HTM file? Yes. Hey, don't throw the tomatoes stinky eggs first, look carefully, although this is a standard HTM file, but you save it as a file with a suffix. ASPX, and then run in the browser. Let's, this is an out -of -the -box ASP+file, your first ASP+program. Because ASP+is compatible with ASP forward, any ASP file can be run as ASP+files. Let us change the file above and change the names and category in front of the two inputs to names and categories, just like below This file:
intro1c.aspx
<html>
<head>
<link rel = styleSheethref = intro.css>
</head>
<body>
<Center>
<FORM ACTION = Intro1.aspx Method = Post>
<h3> Name: <input ID = name type = text>
Category: <select ID = Category Size = 1>
<option> psychology </option>
<option> Business </option>
<option> Popul_comp </option>
</select>
<input type = submit value = lookup>
</form>
</center>
</body>
</html>
What happened to you run again this time? What, Chinese characters have become? Intersection Is the number? Yes, yes, on the surface, Chinese characters are not supported, but in fact we have a way to solve it. Find Winnt/Complus/[Version] /config.web. Note that [versions] refers Like this: Winnt/Complus/1812.9/Config.web, open this file with a notepad, find the following lines:
<globalization
Requestencoding = US-ASCII
responsencoding = ISO-8859-1
/>
See that "ISO-8859-1"? Yes, it is this stuff that does not show Chinese characters. Change it to "GB2312" and everything is OK. It is running again. How about seeing the Chinese characters you are familiar with?
Okay, it's more than 2 o'clock in the middle of the night. I will talk about it today. I will continue tomorrow.