缓存,随机,时间,消除空格
1.htm
-------------
<script language= "JavaScript " id= "_0009 " src= "1.js?id=45 "> </script>
1.js
-------------
var me = document.getElementById( "_0009 ");
if(me != null) document.writeln(me.src.replace(/^[^?]+(?:\?id=(\d+)|.*)$/, "$1 "));
IF DATALENGTH(@body) > 0
判断为空
if body is null
可以的. 修改web.config,修改bin目录都会导致应用程序重启
DateTime dt = DateTime.Parse( "2007-8-9 17:16:00 ");
string str = dt.ToUniversalTime().ToString( "r "); // Thu, 09 Aug 2007 09:16:00 GMT
static int j = 0;
private void Page_Load(object sender, System.EventArgs e)
{
Response.Write(GetRandString(16, "0123456789 "));
Response.Write( " <br/> ");
Response.Write(GetRandString(16, "0123456789 "));
}
// 获取随机串
private string GetRandString(int count, string str)
{
string randString = " ";
Random rand = new Random( DateTime.Now.Millisecond j++);
for (int i = 0; i < count; i++)
{
int t = rand.Next(str.Length);
randString += str[t];
}
return randString;
}
静态页面缓存<meta http-equiv="pragma" content="no-cache">
DateTime a = DateTime.Now.AddDays(-1);
DateTime b = a.Subtract(DateTime.Now);
是asp.net的postback特性,通常刷新的时候会问你“是不是要重新提交表单”之类的话 一个解决方法是,添加功能执行后,用Response.Redirect重定向到当前页面,这样就不会有刷新问题了
正则做一下吧 input = Regex.Replace(input, @"(\r\n){2,}", "\r\n", RegexOptions.Multiline); input = Regex.Replace(input, @"\n{2,}}", "\n", RegexOptions.Multiline); input = Regex.Replace(input, @" {2,}", " ", RegexOptions.Multiline);