|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
一般的指的.net就是跟java相对的那种,主要是做企业级应用的。你如果想学这个,主要就是学C#和数据库。(ASP.NET好像很重要的,应该也要学的,ASP.NET上好像可以结合VB和C#等多种语言,但是微软主推C#)以下是援用片断:
以下为援用的内容:
#region///过滤html,js,CSS代码
///<summary>
///过滤html,js,css代码
///</summary>
///<paramname="html">参数传进</param>
///<returns></returns>
publicstaticstringCheckStr(stringhtml)
{
System.Text.RegularExpressions.Regexregex1=newSystem.Text.RegularExpressions.Regex(@"<script[sS]+</script*>",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
System.Text.RegularExpressions.Regexregex2=newSystem.Text.RegularExpressions.Regex(@"href*=*[sS]*script*:",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
System.Text.RegularExpressions.Regexregex3=newSystem.Text.RegularExpressions.Regex(@"no[sS]*=",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
System.Text.RegularExpressions.Regexregex4=newSystem.Text.RegularExpressions.Regex(@"<iframe[sS]+</iframe*>",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
System.Text.RegularExpressions.Regexregex5=newSystem.Text.RegularExpressions.Regex(@"<frameset[sS]+</frameset*>",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
System.Text.RegularExpressions.Regexregex6=newSystem.Text.RegularExpressions.Regex(@"<img[^>]+>",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
System.Text.RegularExpressions.Regexregex7=newSystem.Text.RegularExpressions.Regex(@"</p>",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
System.Text.RegularExpressions.Regexregex8=newSystem.Text.RegularExpressions.Regex(@"<p>",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
System.Text.RegularExpressions.Regexregex9=newSystem.Text.RegularExpressions.Regex(@"<[^>]*>",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
html=regex1.Replace(html,"");//过滤<script></script>标志
html=regex2.Replace(html,"");//过滤href=javascript:(<A>)属性
html=regex3.Replace(html,"_disibledevent=");//过滤别的控件的on...事务
html=regex4.Replace(html,"");//过滤iframe
html=regex5.Replace(html,"");//过滤frameset
html=regex6.Replace(html,"");//过滤frameset
html=regex7.Replace(html,"");//过滤frameset
html=regex8.Replace(html,"");//过滤frameset
html=regex9.Replace(html,"");
html=html.Replace("","");
html=html.Replace("</strong>","");
html=html.Replace("<strong>","");
returnhtml;
}
#endregion
#region///过滤p/p代码
///<summary>
///过滤p/p代码
///</summary>
///<paramname="html">参数传进</param>
///<returns></returns>
publicstaticstringInputStr(stringhtml)
{
html=html.Replace(@"<img[^>]+>","");
html=html.Replace(@"<p>","");
html=html.Replace(@"</p>","");
returnhtml;
}
#endregion
///<summary>
///截取字符串
///</summary>
///<paramname="str"></param>
///<paramname="length"></param>
///<returns></returns>
protectedstringGetLength(stringstr,intlength)
{
stringstrR=str;
if(str.Length>length)
{
strR=str.Substring(0,length)+"...";
}
returnstrR;
}
是不是实质都是API?有的好像不只是API那么简单的,有的也是一种框架就像MFC一样。有的还是一种思想(就是做软件的思想)(好像很深奥,其实我也不懂^_^) |
|