
方法一:FSOSetfs=CreateObject("Scripting.FileSystemObject")NewFile=Server.MapPath("/asp/chap06/at/newfile.html")'新建一文件/newfile.html,若该文件已存在,则覆盖它Seta=fs.CreateTextFile(NewFile,True)Response.Write"新文件已建立!"a.closeFile=Server.MapPath("newfile.html")Settxt=fs.OpenTextFile(File,8,True)'打开成可以在结尾写入数据的文件data1="这句话是使用WriteLine方...

ASP.NETC#+SQL如何向数据库插入当前时间?想做一个新闻发布系统,在发布页插入数据库时需要插入一个当前时间~如下:stringstr1=TextBox5.Text;stringstr2=TextBox6.Text;DateTimenow=DateTime.Now;SqlConnectionconn=newSqlConnection("***");conn.Open();SqlCommandcmd=newSqlCommand();cmd.Connection=conn;//获取用户名称cmd.CommandText="selectusers_namefromuserswhereusers_id="+Session...