//alert("fefffffffffffe");
var xmlHttp;
// Firefox, Opera 8.0+, Safari
xmlHttp = new XMLHttpRequest();
}
catch (e) {
// Internet Explorer
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
alert("您的浏览器不支持AJAX!");
return false;
}
}
}
xmlHttp.send(null);
// xmlHttp.onreadystatechange = function() {
// if (xmlHttp.readyState == 4) {
// 不需要界面响应,
// }
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Threading;
using System.IO;
{
public partial class WriteLog : System.Web.UI.Page
{
static Mutex m_WriteMutex = new Mutex();
{
string text = Request.QueryString["text"];
string fileName = @".\Log\ClickLog" + DateTime.Now.ToString(".yyyMMdd");
writeLine(fileName,text);
}
{
FileStream fs = null;
StreamWriter sw = null;
//用于处理多线程
m_WriteMutex.WaitOne();
{
//CHECK文件存在不
if (!File.Exists(fileName))
{
FileStream tempfs = File.Create(fileName);
tempfs.Close();
}
fs.Seek(0, System.IO.SeekOrigin.End);
sw = new StreamWriter(fs, System.Text.Encoding.UTF8);
sw.WriteLine(dataText);
{
sw.Close();
sw = null;
}
if (fs != null)
{
fs.Close();
fs = null;
}
{
}
{
try
{
if (sw != null)
{
sw.Close();
sw = null;
}
{
fs.Close();
fs = null;
}
}
catch
{
}
}
}
}
}
















