1.Global.asax中Session_Start()中添加
List<string> files = Session["VoiceFiles"] as List<string>;
string fileName = Path.GetRandomFileName() + ".wav";
List<string> files = Session["VoiceFiles"] as List<string>;
foreach (string fileName in files)
{
try
{
File.Delete(fileName);
}
catch (IOException) {/*...*/}
}
Session["VoiceFiles"] = new List<string>();
List<string> files = Session["VoiceFiles"] as List<string>;
string fileName = Path.GetRandomFileName() + ".wav";
files.Add(fileName);
List<string> files = Session["VoiceFiles"] as List<string>;
foreach (string fileName in files)
{
try
{
File.Delete(fileName);
}
catch (IOException) {/*...*/}
}