HashMap access to data in Java is convenient, but there are no similar classes in the ASP. The author needs similar data type in the development program, then constructs a class that can basically resemble the HashMap function, can realize the key value access operation and so on, the data that accesses can be any basic type in the ASP.
The following is the code for the program, which is posted to an empty ASP to run directly.
<% Set jb51 = new Jb ' assigns values to MP objects Jb51.putv "a", "Jb51.net" JB51.PUTV "B", "Www.jb51.net" JB51.PUTV "C", "http://www.jb5 1.net "Response.Write" [Number of key values]: "&jb51.count Response.Write" <br> "Response.Write" [A]: "&jb51.getv (" a ") r Esponse.write "<br>" Response.Write ":" &jb51.getv ("B") Response.Write "<br>" Response.Write "[C]:" & Amp;jb51.getv ("C") Response.Write "
The above is the sharing of ASP how to achieve a similar HashMap function class, I hope that the learning of everyone inspired.