SetWD_DelZoneFile.aspx.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using HNWD.Pregrant.WebService;
  8. using HNWD.Pregrant.Model;
  9. using System.Text;
  10. using HNWD.Pregrant.DataAccess;
  11. using HNWD.Pregrant.Common;
  12. using HNWD.Pregrant.BusinessLogic;
  13. using System.IO;
  14. namespace HNWD.Pregrant.WebService.MgrCSharp
  15. {
  16. public partial class SetWD_DelZoneFile : PageBase
  17. {
  18. protected void Page_Load(object sender, EventArgs e)
  19. {
  20. string SoundFileDir = Request.PhysicalApplicationPath + @"MP3\";
  21. if(Directory.Exists(SoundFileDir))
  22. {
  23. Directory.CreateDirectory(SoundFileDir);
  24. }
  25. string FileName = this.GetValueByKey("FileName");
  26. if(string.IsNullOrEmpty(FileName) || !File.Exists(SoundFileDir + FileName))
  27. {
  28. this.ResponseDefaultError();
  29. return;
  30. }
  31. File.Delete(SoundFileDir + FileName);
  32. this.ResponseDefaultOk();
  33. }
  34. }
  35. }