Example #1
0
 public static void FileAppendLine(string path, AbFileInfo data)
 {
     using (StreamWriter sw = new StreamWriter(path, true))
     {
         sw.WriteLine(data.ToString());
         sw.Close();
     }
 }
Example #2
0
    private Dictionary <string, AbFileInfo> GetLatelyBuildFilesData()
    {
        Dictionary <string, AbFileInfo> ProjectDic = new Dictionary <string, AbFileInfo>();
        string projectFilePath = StreamingAssets + "files.txt";
        string latelyFile      = File.ReadAllText(projectFilePath);

        ProjectDic = AbFileInfo.DeCode(latelyFile);
        return(ProjectDic);
    }
Example #3
0
    public static Dictionary <string, AbFileInfo> DeCode(string data)
    {
        Dictionary <string, AbFileInfo> totals = new Dictionary <string, AbFileInfo>();

        if (string.IsNullOrEmpty(data))
        {
            return(totals);
        }
        StringReader textReader = new StringReader(data);

        string line;

        while (!string.IsNullOrEmpty(line = textReader.ReadLine()))
        {
            AbFileInfo abFileInfo = new AbFileInfo(line);
            totals[abFileInfo.FileName] = abFileInfo;
        }
        return(totals);
    }
Example #4
0
    private Dictionary <string, AbFileInfo> GetHistoricalFilesData()
    {
        Dictionary <string, AbFileInfo> historocalInfoDic = new Dictionary <string, AbFileInfo>();

        string[] Paths = Directory.GetFiles(SaveHistoricalPath);
        if (Paths.Length < 0)
        {
            return(historocalInfoDic);
        }
        //提取FilesNames
        string TargetFilePath = "";
        long   tempLatelyDate = 0;

        foreach (string ps in Paths)
        {
            string   whileFileName = Path.GetFileNameWithoutExtension(ps);
            string[] sname         = whileFileName.Split('_');
            if (sname.Length < 2)
            {
                continue;
            }
            long timeSpan = long.Parse(sname[1]);
            if (timeSpan > tempLatelyDate)
            {
                tempLatelyDate = timeSpan;
                TargetFilePath = ps;
            }
        }
        if (string.IsNullOrEmpty(TargetFilePath))
        {
            return(historocalInfoDic);
        }
        //解析上一次打包的file文件
        string FileContent = File.ReadAllText(TargetFilePath);

        historocalInfoDic = AbFileInfo.DeCode(FileContent);
        return(historocalInfoDic);
    }