1,DataSet判断其中数据是否为空值
bool DataRow.IsNull(DataColumn あるいは int あるいは string)
2, String scriptString = "<script language=JavaScript> function DoClick() {";
scriptString += "showMessage2.innerHTML='<h4>Welcome to Microsoft .NET!</h4>'}";
scriptString += "function Page_Load(){ showMessage1.innerHTML=";
scriptString += "'<h4>RegisterStartupScript Example</h4>'}</script>";
if(!this.IsStartupScriptRegistered("Startup"))
this.RegisterStartupScript("Startup", scriptString);//声明javascript函数在紧接着<from>之后,在所有html控件之前声明事件
if(!IsPostBack)
this.RegisterRequiresPostBack(TextBox1);//声明javascript函数在</from>之前,以保证。所有的控件都已经声明在先
3, Response.AddHeader "Content-Disposition","attachment; filename=fname.ext"
文件头指明文件格式
4, DateTime.TryParse()
DateTime.Parse(strDate);//日期字符串转为日期类型
DateTime.ParseExact(strDate, "yyyyMMdd", CultureInfo.CurrentCulture);
bool DataRow.IsNull(DataColumn あるいは int あるいは string)
2, String scriptString = "<script language=JavaScript> function DoClick() {";
scriptString += "showMessage2.innerHTML='<h4>Welcome to Microsoft .NET!</h4>'}";
scriptString += "function Page_Load(){ showMessage1.innerHTML=";
scriptString += "'<h4>RegisterStartupScript Example</h4>'}</script>";
if(!this.IsStartupScriptRegistered("Startup"))
this.RegisterStartupScript("Startup", scriptString);//声明javascript函数在紧接着<from>之后,在所有html控件之前声明事件
if(!IsPostBack)
this.RegisterRequiresPostBack(TextBox1);//声明javascript函数在</from>之前,以保证。所有的控件都已经声明在先
3, Response.AddHeader "Content-Disposition","attachment; filename=fname.ext"
文件头指明文件格式
4, DateTime.TryParse()
DateTime.Parse(strDate);//日期字符串转为日期类型
DateTime.ParseExact(strDate, "yyyyMMdd", CultureInfo.CurrentCulture);
public static bool IsDate(string strDate) { DateTime dtDate; bool bValid = true; try { dtDate = DateTime.Parse(strDate); } catch (FormatException eFormatException) { string message = eFormatException.Message; //eFormatExceptionが使用されないというワーニングを抑制するため。 // the Parse method failed => the string strDate cannot be converted to a date. bValid = false; } return bValid; }
5,涉及到,系统文件读写权限的.Net配置模式
要注意以下几点的配置
*1,IIS中的站点属性设置中,配置[安全]中的匿名登陆与认证,将用户指定Administrator
(好危险的样子,不过我试过用别的角色,都不行啊!!那位大哥告诉我一下,该怎么办呢)。
*2, Web.config 中
配置<configuration>
<identity impersorate=“true“/>
<authentication mode=“windows“/>
<appSettings>//顺便带上数据库设置,呵呵,必不可少阿
<add key=“strConn“ value=“server=IP;database=DBName;uid=UserID;pwd=Password;“/>
</appSettings>
</configuration>