错误写入日志.txt

来自「非常好的.net学习经验记录」· 文本 代码 · 共 16 行

TXT
16
字号
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);
						sw1.WriteLine("IP:" + Request.ServerVariables["REMOTE_ADDR"].ToString());
						sw1.WriteLine("*************************************************");
						sw1.Close();
					}
					catch
					{
						throw;
					}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?