//get current directory
string sCurDir=Server.MapPath(".");
string sSubDir=sCurDir+"\\xxx";
//就是上面几句啦.//create file
string sFileName=sSubDir+"\\"+System.DateTime.Now.Millisecond.ToString()+".txt";
//Response.Write (sFileName);
try
{
if (!File.Exists(sFileName))
{
FileStream fsText=File.Create(sFileName);
StreamWriter swText=new StreamWriter(fsText);
swText.Write("how are you");
swText.WriteLine();
swText.WriteLine(sFileName);
swText.WriteLine(System.DateTime.Now.ToString()); char[] b = {'a','b','c','d','e','f','g','h','i','j','k','l','m'};
swText.Write(b,3,8);
swText.WriteLine("阿洒洒洒可靠");
swText.Flush();
swText.Close();
}
}
catch(IOException ioe)
{
Response.Write(ioe.Message.ToString());
}