コード例 #1
0
        public async Task <string> SaveFileFromString(string text, string extantion, string folderName, string fileName)
        {
            //String content i .txt extantion ile kaydediyorum.
            var lf           = new LocalFile();
            var folderExists = await lf.FolderExists(folderName);

            if (!folderExists)
            {
                await lf.CreateFolder(folderName);
            }
            var retVal = await lf.SaveFileFromStringContent(folderName, fileName + "." + extantion, text);

            return(retVal);
        }
コード例 #2
0
        public async Task <string> GetSavedFile(string folderName, string fileName, string extantion)
        {
            var lf = new LocalFile();

            if (!await lf.FolderExists(folderName))
            {
                return(string.Empty);
            }
            //extantion .txt
            var retVal = await lf.ReadFileAsString(folderName, fileName + extantion);

            if (string.IsNullOrEmpty(retVal))
            {
                return(string.Empty);
            }
            return(retVal);
        }