看一下还比较实用吧


try
    {
      System.IO.FileStream fs1 = new System.IO.FileStream(HttpContext.Current.Server.MapPath("../labourdb/logtxt.txt"), System.IO.FileMode.Append);
      System.IO.StreamWriter sw1 = new System.IO.StreamWriter(fs1);
      sw1.WriteLine("**************************************************");
      sw1.WriteLine("日期:" + System.DateTime.Now);
      sw1.WriteLine("登入名:" + txt_id.Text);
      sw1.WriteLine("密码:" + txt_pwd.Text);//51aspx
      sw1.WriteLine("IP:" + Request.ServerVariables["REMOTE_ADDR"].ToString());
      sw1.WriteLine("*************************************************");
      sw1.Close();
    }
    catch
    {
      throw;
    }

相关文章:

  • 2021-06-25
  • 2021-08-18
  • 2021-08-05
  • 2022-02-12
  • 2022-12-23
  • 2021-11-21
  • 2022-02-03
猜你喜欢
  • 2021-08-18
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2021-09-15
相关资源
相似解决方案