|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
优点:简单易学、开发速度快、有很多年“历史”,能找到非常多别人做好的程序来用、配合activeX功能强大,很多php做不到的asp+activeX能做到,例如银行安全控件控件C#版:
usingSystem;
usingSystem.Web;
usingSystem.Web.UI;
usingSystem.Collections;
usingSystem.Collections.Specialized;
usingSystem.Globalization;
usingSystem.Reflection;
usingSystem.Text;
[assembly:AssemblyTitle("")]
[assembly:AssemblyDescription("AQuickStartTutorialAssembly")]
[assembly:AssemblyConfiguration("")]
[assembly:AssemblyCompany("MicrosoftCorporation")]
[assembly:AssemblyProduct("MicrosoftQuickStartTutorials")]
[assembly:AssemblyCopyright("MicrosoftCorporation.Allrightsreserved.")]
[assembly:AssemblyTrademark("")]
[assembly:AssemblyCulture("")]
[assembly:AssemblyVersion("1.1.*")]
namespaceAcme
{
publicclassCalendar:Control,IPostBackEventHandler,IPostBackDataHandler
{
privateString[]monthNames=newString[12];
privateDateTimecurrentDate=DateTime.Now;
privateStringbackColor="#dcdcdc";
privateStringforeColor="#eeeeee";
protectedoverridevoidOnInit(EventArgsE)
{
Page.RegisterRequiresPostBack(this);
currentDate=DateTime.Now;
monthNames[0]="January";
monthNames[1]="February";
monthNames[2]="March";
monthNames[3]="April";
monthNames[4]="May";
monthNames[5]="June";
monthNames[6]="July";
monthNames[7]="August";
monthNames[8]="September";
monthNames[9]="October";
monthNames[10]="November";
monthNames[11]="December";
}
protectedoverridevoidLoadViewState(ObjectviewState)
{
//Ifwevedoneapost-back,theolddatewillbeavailabletous
if(null!=viewState)
{
currentDate=DateTime.Parse((String)viewState);
}
}
publicvoidRaisePostBackEvent(StringeventArgument)
{
//Page.Response.Write("RaisePostBackEventCalled!!!");
if(eventArgument==null)
{
return;
}
//Keeptrackofolddate(foreventfiringpurposes)
DateTimeoldDate=currentDate;
if(String.Compare("NavNextMonth",eventArgument,true,CultureInfo.InvariantCulture)==0)
{
currentDate=currentDate.AddMonths(1);
}
elseif(String.Compare("NavPrevMonth",eventArgument,true,CultureInfo.InvariantCulture)==0)
{
currentDate=currentDate.AddMonths(-1);
}
else
{
intdaySelected=Int32.Parse(eventArgument);
currentDate=newDateTime(currentDate.Year,currentDate.Month,daySelected);
}
}
protectedoverrideObjectSaveViewState()
{
//SaveCurrentDateoutasviewstateforpostbackscenarios
returncurrentDate.ToString();
}
protectedoverridevoidRender(HtmlTextWriteroutput)
{
if((Page.Request.UserAgent!=null)&&
(Page.Request.Browser.Browser.ToUpper(CultureInfo.InvariantCulture).IndexOf("IE")>-1)&&
(Double.Parse(Page.Request.Browser.Version)>=5.5))
RenderUpLevel(output);
else
RenderDownLevel(output);
}
protectedvoidRenderUpLevel(HtmlTextWriteroutput)
{
output.WriteLine("<inputname="+UniqueID+"_CurrentDateid="+UniqueID+"_CurrentDatetype=hidden>");
output.WriteLine("<spanid="+UniqueID+"></span>");
output.WriteLine("<scriptlanguage=jscript>drawcalendar("+UniqueID+","+currentDate.Year.ToString()+"/"+current</p>想法是和程序员的想法不一样的.至于为什么.大家去想一想.跟心理学有关的 |
|