Session

1.Global.asax中Session_Start()中添加

Session["VoiceFiles"] = new List<string>();

2.用到时
List<string> files = Session["VoiceFiles"] as List<string>;
string fileName = Path.GetRandomFileName() + ".wav";

files.Add(fileName);

3.退出时
        List<string> files = Session["VoiceFiles"] as List<string>;
        foreach (string fileName in files)
        {
            try
            {
                File.Delete(fileName);
            }
            catch (IOException) {/*...*/}
        }
原文地址:https://www.cnblogs.com/tuzhiye/p/1379995.html