62,074
社区成员
发帖
与我相关
我的任务
分享
string clientIp = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();// WbfTools.BLL.Utils.GetIP();
string clientURL = System.Web.HttpContext.Current.Request.Url.ToString();
string serverParch = System.Web.HttpContext.Current.Server.MapPath("~/");
//写日志
System.IO.StreamWriter sw = System.IO.File.AppendText(serverParch + "\\sqlin.txt");//System.Net.WebRequestMethods.File.AppendText(serverParch + "\\sqlin.txt");
sw.WriteLine("IP:" + clientIp + " URL:" + clientURL + " DateTime:" + DateTime.Now.ToString());
sw.Flush();
sw.Close();
sw.Dispose();