[求助]system.io 写入txt文件问题?
<%@ Import Namespace ="System.IO" %><script language ="C#" runat ="server">
protected void Page_Load(object sender, EventArgs e)
{
Response.Write ("<h3>"+"写入TXT文件的简单示例"+"<br></h3>");
String lujin=@"G:\myweb\net\read.txt";
if(!File.Exists (lujin))
{
StreamWriter writin;
writin = File.CreateText(lujin);
writin.WriteLine("my name is sunyong I am happy!");
writin.Close();
}
else
{
Response.Write("已经存入些文件!");
}
}
</script>
为什么写不进去。。。运行后直接就显示“已经存入些文件”请问这是为什么?高手们帮帮忙!!