小魔女 发表于 2015-1-16 23:22:51

ASP网页编程之MSGBOX前往值

专业性的服务。有的ASP商提供垂直型的应用服务,针对某一特定行业提供应用服务。MsgBoxFunction
Displaysamessageinadialogbox,waitsfortheusertoclickabutton,andreturnsavalueindicatingwhichbuttontheuserclicked.

MsgBox(prompt[,buttons][,title][,helpfile,context])

Arguments
prompt

Stringexpressiondisplayedasthemessageinthedialogbox.Themaximumlengthofpromptisapproximately1024characters,dependingonthewidthofthecharactersused.Ifpromptconsistsofmorethanoneline,youcanseparatethelinesusingacarriagereturncharacter(Chr(13)),alinefeedcharacter(Chr(10)),orcarriagereturnClinefeedcharactercombination(Chr(13)&Chr(10))betweeneachline.

buttons

Numericexpressionthatisthesumofvaluesspecifyingthenumberandtypeofbuttonstodisplay,theiconstyletouse,theidentityofthedefaultbutton,andthemodalityofthemessagebox.SeeSettingssectionforvalues.Ifomitted,thedefaultvalueforbuttonsis0.

title

Stringexpressiondisplayedinthetitlebarofthedialogbox.Ifyouomittitle,theapplicationnameisplacedinthetitlebar.

helpfile

StringexpressionthatidentifiestheHelpfiletousetoprovidecontext-sensitiveHelpforthedialogbox.Ifhelpfileisprovided,contextmustalsobeprovided.Notavailableon16-bitplatforms.

context

NumericexpressionthatidentifiestheHelpcontextnumberassignedbytheHelpauthortotheappropriateHelptopic.Ifcontextisprovided,helpfilemustalsobeprovided.Notavailableon16-bitplatforms.

Settings
Thebuttonsargumentsettingsare:

ConstantValueDescription
vbOKOnly0DisplayOKbuttononly.
vbOKCancel1DisplayOKandCancelbuttons.
vbAbortRetryIgnore2DisplayAbort,Retry,andIgnorebuttons.
vbYesNoCancel3DisplayYes,No,andCancelbuttons.
vbYesNo4DisplayYesandNobuttons.
vbRetryCancel5DisplayRetryandCancelbuttons.
vbCritical16DisplayCriticalMessageicon.
vbQuestion32DisplayWarningQueryicon.
vbExclamation48DisplayWarningMessageicon.
vbInformation64DisplayInformationMessageicon.
vbDefaultButton10Firstbuttonisdefault.
vbDefaultButton2256Secondbuttonisdefault.
vbDefaultButton3512Thirdbuttonisdefault.
vbDefaultButton4768Fourthbuttonisdefault.
vbApplicationModal0Applicationmodal;theusermustrespondtothemessageboxbeforecontinuingworkinthecurrentapplication.
vbSystemModal4096Systemmodal;allapplicationsaresuspendeduntiltheuserrespondstothemessagebox.


Thefirstgroupofvalues(0C5)describesthenumberandtypeofbuttonsdisplayedinthedialogbox;thesecondgroup(16,32,48,64)describestheiconstyle;thethirdgroup(0,256,512,768)determineswhichbuttonisthedefault;andthefourthgroup(0,4096)determinesthemodalityofthemessagebox.Whenaddingnumberstocreateafinalvaluefortheargumentbuttons,useonlyonenumberfromeachgroup.

ReturnValues
TheMsgBoxfunctionhasthefollowingreturnvalues:

ConstantValueButton
vbOK1OK
vbCancel2Cancel
vbAbort3Abort
vbRetry4Retry
vbIgnore5Ignore
vbYes6Yes
vbNo7No


Remarks
Whenbothhelpfileandcontextareprovided,theusercanpressF1toviewtheHelptopiccorrespondingtothecontext.

IfthedialogboxdisplaysaCancelbutton,pressingtheESCkeyhasthesameeffectasclickingCancel.IfthedialogboxcontainsaHelpbutton,context-sensitiveHelpisprovidedforthedialogbox.However,novalueisreturneduntiloneoftheotherbuttonsisclicked.

WhentheMsgBoxfunctionisusedwithMicrosoftInternetExplorer,thetitleofanydialogpresentedalwayscontains"VBScript:"todifferentiateitfromstandardsystemdialogs.

ThefollowingexampleusestheMsgBoxfunctiontodisplayamessageboxandreturnavaluedescribingwhichbuttonwasclicked:

DimMyVar
MyVar=MsgBox("HelloWorld!",65,"MsgBoxExample")
MyVarcontainseither1or2,dependingonwhichbuttonisclicked.
Requirements

</p>ASP是依赖组件的,能访问数据库的组件好多就有好多种,再有就是你微软的工具可是什么都要收钱的啊!

谁可相欹 发表于 2015-1-20 09:44:56

Application:这个存储服务端的数据,如果不清除,会直到web应用程序结束才清除(例如重启站点)

变相怪杰 发表于 2015-1-29 06:34:10

你可以通过继承已有的对象最大限度保护你以前的投资。并且C#和C++、Java一样提供了完善的调试/纠错体系。

蒙在股里 发表于 2015-2-5 23:15:40

ASP主要是用好六个对象,其实最主要的是用好其中两个:response和request,就可以随心所欲地控制网页变换和响应用户动作了。

因胸联盟 发表于 2015-2-14 04:33:45

先学习用frontpage熟悉html编辑然后学习asp和vbscript建议买书进行系统学习

爱飞 发表于 2015-3-4 04:34:28

ASP(ActiveServerPages)是Microsfot公司1996年11月推出的WEB应用程序开发技术,它既不是一种程序语言,也不是一种开发工具,而是一种技术框架,不须使用微软的产品就能编写它的代码,能产生和执行动态、交互式、高效率的站占服务器的应用程序。

不帅 发表于 2015-3-4 04:34:28

Server:这个表示的服务器,操作服务器的一些东西使用这个,如Server.Mappath转换服务器路径,Server.CreateObject实例化一个组件

灵魂腐蚀 发表于 2015-3-11 16:45:05

尽管MS自己讲C#内核中更多的象VC,但实际上我还是认为它和Java更象一些吧。首先它是面向对象的编程语言,而不是一种脚本,所以它具有面向对象编程语言的一切特性,比如封装性、继承性、多态性等等,这就解决了刚才谈到的ASP的那些弱点。

再现理想 发表于 2015-3-27 03:10:30

ASP的语言不仅仅只是命令格式差不多,而是包含在<%%>之内的命令完全就是VB语法。虽然ASP也是做为单独的一个技术来提出的,但他就是完全继承了VB所有的功能。
页: [1]
查看完整版本: ASP网页编程之MSGBOX前往值