Common/DoFile.cs

(开头部分) 7KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.IO;
using System.Web;
using System.Text;
using System.Threading;
/// <summary>
/// DoFile 的摘要说明。
/// </summary>
public class DoFile
{
    public DoFile()
    {
        //
        // TODO: 在此处添加构造函数逻辑
        //
    }

    /// 删除指定文件
    /// </summary>
    /// <param name="filename">虚拟路径  不是 全部绝对路径</param>
    /// <returns></returns>
    public static int DeleteFile(string filename)
    {
        if (filename == string.Empty || filename == "" || filename == null)
            return 0;
        else
        {
            if (File.Exists(System.Web.HttpContext.Current.Server.MapPath(filename)))
            {
                File.Delete(System.Web.HttpContext.Current.Server.MapPath(filename));
                return 1;
            }
            return 0;
        }
    }

    public static bool MoveConfig(int type, string folder)
    {
        string file = "";
        if (type == 0)
        {
            //代表默认的程序-->修改为一
            file = HttpContext.Current.Server.MapPath("~/" + folder + "/config/html/web.config");


        }
        else
        {
            //修改为其他的
            file = HttpContext.Current.Server.MapPath("~/" + folder + "/config/aspx/web.config");
        }

        string newfile = HttpContext.Current.Server.MapPath("~/web.config");
        try
        {
            if (File.Exists(file))
            {
                if (File.Exists(newfile))
                {
                    File.Delete(newfile);
后面还有 189 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。