Пример #1
0
        private string GetTempFile(FileEvent e)
        {
            AbsolutePath tmpPath = new AbsolutePath(Path.GetTempPath() + CommonHelper.GetRandomHash());

            Directory.CreateDirectory(tmpPath);

            string name = e.Name.Substring(e.Name.IndexOf("/") + 1, e.Name.Length - e.Name.IndexOf("/") - 1);

            if (e.SHA1 == null)
            {
                File.WriteAllText(tmpPath.File(name), "");
            }
            else
            {
                File.Copy(Config.MetaFolderData.File(e.SHA1), tmpPath.File(name));
            }

            return(tmpPath.File(name));
        }