ASP 잚淚痙
2018-09-06 12:59
拮목뒈綱,ASP깻꼇角寧쳔긍넋刀喇,杰鹿꼇닸瞳잚侶寧매쿡,乖쳬侶쟁綱ASP잚角寧ASP돨긍넋刀喇VBScript瞳ASP쟁壇痰珂돨잚。
ASP잚궐싹숌데,劍꼇야唐廬攣雷屢잚돨셨넓、路潼된景昑,쐴밗흔늪,劍휄횔角렷끽唐痰돨,劍슉됴죄乖쳬긍넋돨릿憧똑,賈乖쳬돨넋埼친욥뫘속북잿。
ASP잚連넣痂척ASP잚궐싹숌데,劍꼇야唐廬攣雷屢잚돨셨넓、路潼된景昑。劍連넣鹿苟코휭:
무唐냥逃긴좆、降唐냥逃긴좆、橄昑
무唐냥逃변鑒、降唐냥逃변鑒
뭐芚변鑒、驕뭐변鑒
눼쉔뵨賈痰寧몸離숌데돨ASP잚寧硅놓欺諒꼇잿썩잚뵨뚤蹶돨혐깎,댔몸궐렘,잚봤궐角暠笭,뚤蹶봤궐角몽앴暠笭齡鱗놔돨茄膠。맡刻절못놔죄ASP잚섟뚤蹶돨숌데刻절,맡잚쏭벵唐寧몸냥逃변鑒,痰鹿썩姦잚돨샘굶목駕,깻못놔눼쉔、姦렴뚤蹶돨렘랬。圈玖코휭ASP잚냥逃긴좆、냥逃변鑒、뭐芚驕뭐변鑒侶角寧몸궐싹供憐돨잚쉿썩,杰唐돨쉿썩떼唐鬧姦돨렘駕畇瞳넋埼돨텃긋。繫법敦뗍굶쌘,뚤ASP잚唐寧몸싹槨홍충돨잿썩,옵鹿쏵契ASP잚친욥돨역랙。圈玖코휭ASP잚橄昑ASP잚橄昑宅ASP잚무唐냥逃긴좆宮궐야唐鹿苟寧硅景듐。
옵鹿瞳립令돨谿珂獵契페劍묘콘
옵鹿횅땍립令렀鍋
옵鹿쉥?擁ⓙ뻑점↗뿅늦轍?nbsp;
杰鹿ASP잚橄昑冷角궐싹끽痰할路狼돨。圈玖코휭ASP잚莉북ASP잚돨묘콘茄瞳唐掘,杰鹿唐珂乖쳬狼茄君릿憧돨묘콘,怜봤痰莉북윱茄君。
눼쉔寧몸離숌데돨ASP잚
classCFoo
subPrintHello()
response.WriteHelloWorld!
endsub
endclass
옵鹿였놔,ASP잚돨샘굶써뭐角:
class잚츰
잚덜쯤
endclass
賈痰寧몸離숌데돨ASP잚
dimobj
setobj=newCFoo賈痰setnew눼쉔뚤蹶,譚黨꼇角륩蛟포莉숭,杰鹿꼇콘痰server.CreateObject눼쉔
callobj.PrintHello뚤蹶츰냔빈속듐,疼뫄냥逃긴좆、橄昑샀변鑒,깊刻딧痰맡뚤蹶돨냥逃긴좆、橄昑샀변鑒,쉥鞫刻HelloWorld!
setobj=nothing姦렴뚤蹶
ASP잚쟁꼇콘路潼뭐芚변鑒,杰鹿乖쳬꼇콘賈痰잚慨黨setobj=newCFoo(param)돨刀얌윱눼쉔잚。
ASP잚돨묘콘茄瞳唐掘,杰鹿唐珂乖쳬狼茄君릿憧돨묘콘,怜봤痰莉북윱茄君。
classCFish
subSwim()
endsub
endclass
classCBird
subFly()
endsub
endclass
classCAnimal
dimfish
dimbird
privatesubclass_initialize()
setfish=newCFish
setbird=newCBird
endsub
privatesubclass_terminate()
setfish=nothing
setbird=nothing
endsub
endclass
dimanimal
setanimal=newCAnimal
callanimal.fish.Swim()戴踏
callanimal.bird.Fly()쿰령
setanimal=nothing
ASP잚橄昑
classCFoo
privatepvt
橄昑畇
publicpropertyletpropName(v)
pvt=v
endproperty
橄昑뗍
publicpropertygetpropName()
PropName=pvt
endproperty
endclass
dimobj
setobj=newCFoo
obj.propName=橄昑令
response.Write(obj.propName)鞫刻“橄昑令”
setobj=nothing
옵鹿였놔橄昑令宮뎠黨角瞳降唐냥逃긴좆宅棍썹裂쇌솥죄寧林픕졺,賈崗렘옵鹿빳宮繫斤。
唐훙앎삔狂橄昑뫄무唐냥逃긴좆寧湳,劍돨닸瞳棠唐痂척뗌접돨雷屢켱?
1、옵鹿瞳립令돨谿珂獵契페劍묘콘
흔苟덜쯤,宮뎠黨谿珂槨좃몸냥逃긴좆립令
publicpropertyletpropName(v)
pvt=v
쥼寧몸降唐냥逃긴좆츰=pvt돨令:&v
endproperty
2、옵鹿횅땍립令렀鍋
솝흔?舅匈筠켁轍凍뉨켑と靈짙?
publicpropertyletpropName(v)
ifLen(v)<=5then
pvt=v
endif
endproperty
獵契obj.propName=몸枷겟푤拱聾쉥꼇삔槨pvt립令냥묘,凜槨맡俚륜눔돨낀똑낚법죄5。
3、옵鹿쉥?擁ⓙ뻑점↗뿅늦轍?
흔?舅匈叫Ъ謨霙櫓퓰?nbsp;let변鑒혼딜,딧痰obj.propName=橄昑令앎삔놔댄,凜槨侶珂빅변鑒怜옵뗍。
classCFoo
dimpublicParam痰dim?願蕩ビ均?逃긴좆
privateprivateParam痰private?願撑쌈均?逃긴좆
publicParam=무唐꼇콘瞳class깃션鹿코、잚변鑒鹿棍槨냥逃긴좆립令
constMAX_LEN=5꼇콘瞳class깃션鹿코、잚변鑒鹿棍賈痰const
맡변鑒槨뭐芚변鑒,瞳賈痰setnew눼쉔뚤蹶珂,菱땡獵契
privatesubclass_initialize()
publicParam=무唐옵鹿瞳侶쟁槨냥逃긴좆립令
privateParam=降唐
endsub
맡변鑒槨驕뭐변鑒,瞳賈痰setnothing姦렴뚤蹶珂,菱땡獵契
privatesubclass_terminate()
response.Write姦렴뚤蹶
endsub
무唐냥逃변鑒(법넋)
냥逃변鑒(법넋)꼇矜狼冷꼇콘?願?
subPrintParam(index)
ifindex=1then
callPrintPublicParam()
elseifindex=2then
callPrintPrivateParam()
endif
endsub
降唐냥逃변鑒(법넋)
怜角궐무唐냥逃변鑒(법넋)뜩寧몸private
privatesubPrintPublicParam()
response.WritepublicParam
endsub
privatesubPrintPrivateParam()
response.WriteprivateParam
endsub
endclass
dimobj
setobj=newCFoo菱땡딧痰class_initialize변鑒,槨publicParam、privateParam립令
obj.publicParam=劤돨무唐
obj.privateParam=劤돨降唐쉥랙?駭鵲徵б榛?nbsp;privateParam角降唐긴좆
callobj.PrintParam(1)鞫刻publicParam돨令
callobj.PrintPublicParam()쉥랙?駭鵲徵б榛?nbsp;PrintPublicParam角降唐변鑒
setobj=nothing菱땡딧痰class_terminate변鑒,鞫刻“姦렴뚤蹶”
上一篇:获取字符中中文首字字符