摘要:
protected void Upload() { //判断是否选择文件 if (FileUpload1.HasFile) { string fileContentType = FileUpload1.PostedFile.ContentType;//获取文件类型 //判断类型是否符合条件 if (fileContentType == "image/bmp" || fileContentType == "image/gif" || fileContentType == "image/pjpeg"||fileContentType==& 阅读全文
摘要:
using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class CalendarThree : System.Web. 阅读全文
摘要:
如何运用内置对象session和application对象实现统计在线人数首先创建一个全局应用程序类Global.asaxprotected void Application_Start(object sender, EventArgs e) { if (Application["CountOnline"] == null) { Application["CountOnline"] = 0; } } //设置session对象,生存时间为1分钟 protected void Session_Start(object sender, EventArgs e 阅读全文
摘要:
(一).Web.Config是以XML文件规范存储,配置文件分为以下格式 1.配置节处理程序声明 特点: 位于配置文件的顶部,包含在标志中。 2.特定应用程序配置 特点: 位于中。 可以定义应用程序的全局常量设置等信息. 3.配置节设置 特点: 位于节中,控制Asp.net运行时的行为. 4.配置节组 特点: 用标记,可以自定义分组,可以放到内部或其它标记的内部. (二).配置节的每一节 1.节 根元素,其它节都是在它的内部. 2.节 此节用于定义应用程序设置项。对一些不确定设置,还可以让用户根据自己实际情况自己设置 用法: I. 定义了一个连接字符串常量,并且在实际应用时可以修改连接... 阅读全文