ASP Contents సమాహారం
Contents సమాహారం అనేది application/session కు స్క్రిప్టు ఆదేశాల ద్వారా జోడించబడిన అన్ని వివరాలను కలిగి ఉంటుంది.
సూచన:Contents సమాహారంలో వివరం తొలగించడానికి, Remove మరియు RemoveAll పద్ధతులను ఉపయోగించండి.
సింహాసనం
Application.Contents(Key) Session.Contents(Key)
పారామితులు | వివరణ |
---|---|
కీ | అవసరమైనది. తీసుకునే పేరు వివరణ. |
Application ఆబ్జెక్టు కొరకు
ఉదాహరణ 1
చూపించండి, name మరియు objtest దానితో సహా Contents సమాహారంలో జోడించబడతాయి:
<% Application(\"name\")=\"W3School\" Set Application(\"objtest\")=Server.CreateObject(\"ADODB.Connection\") %>
ఉదాహరణ 2
Contents సమాహారంలో పరిశీలించండి:
<% for each x in Application.Contents Response.Write(x & \"=\" & Application.Contents(x) & \"<br />") next %>
లేదా:
<% For i=1 to Application.Contents.Count Response.Write(i & \"=\" & Application.Contents(i) & \"<br />") తరువాత %>
ఉదాహరణ 3
<% Application(\"date\")=\"2001/05/05\" Application(\"author\")=\"W3School\" for each x in Application.Contents Response.Write(x & \"=\" & Application.Contents(x) & \"<br />") next %>
输出:
date=2001/05/05 author=W3School
Session ఆబ్జెక్టు కొరకు
ఉదాహరణ 1
చూపించండి, name మరియు objtest దానితో సహా Contents సమాహారంలో జోడించబడతాయి:
<% Session(\"name\")=\"Hege\" Set Session(\"objtest\")=Server.CreateObject(\"ADODB.Connection\") %>
ఉదాహరణ 2
Contents సమాహారంలో పరిశీలించండి:
<% for each x in Session.Contents Response.Write(x & "=" & Session.Contents(x) & "
") next %>
లేదా:
<% For i=1 to Session.Contents.Count Response.Write(i & \"=\" & Session.Contents(i) & \"<br />") తరువాత %>
ఉదాహరణ 3
<% Session(\"name\")=\"Hege\" Session(\"date\")=\"2001/05/05\" for each x in Session.Contents Response.Write(x & "=" & Session.Contents(x) & "
") next %>
输出:
name=Hege date=2001/05/05