zoukankan      html  css  js  c++  java
  • 删除文件

    try
                {
                    foreach (string d in Directory.GetFileSystemEntries(Server.MapPath("~/cs")))
                    {
                        if (File.Exists(d))
                        {
                            string t = d.Split('s')[1].Split('.')[0];
                            if (t == "\\gg3")
                            {
                                File.Delete(Server.MapPath("~/cs/" + d.Split('s')[1] + ""));
                            }
                            else
                            {
                                Response.Write("<script>alert('" + d.Split('s')[1].Split('.')[0] + "')</script>");
                            }
                        }
                    }

                }
                catch
                {
                    Response.Write("<script>alert('文件不存在或路径错误')</script>");
                }

  • 相关阅读:
    [LeetCode]Binary Tree Inorder Traversal
    [LeetCode]Binary Tree Preorder Traversal
    [LeetCode]Number of 1 Bits
    [LeetCode]Best Time to Buy and Sell Stock IV
    第四章 线程
    第三章 进程描述和控制
    第二章 操作系统概述
    第一章 计算机系统概述
    Qt创建对话框的三种方法
    strdup函数
  • 原文地址:https://www.cnblogs.com/caishuowen/p/2177280.html
Copyright © 2011-2022 走看看