Ejemplo n.º 1
0
        public TheResponse ReedThisFile(string filePath)
        {
            var response = new TheResponse();

            response.ThreadId = $" CurrentThread  {Thread.CurrentThread.ManagedThreadId}, {filePath}";
            using (var data = File.OpenText(filePath))
            {
                var str = data.ReadToEnd();
                response.ActionMessage = ActionMessageHelper.ActionResult(str);
            }
            return(response);
        }
Ejemplo n.º 2
0
        public async Task <TheResponse> ReedThisFile(string filePath)
        {
            var response = new TheResponse();

            response.ThreadId = $" CurrentThread  {Thread.CurrentThread.ManagedThreadId}, {filePath} thread after";
            using (var data = File.OpenText(filePath))
            {
                var str = await data.ReadToEndAsync();

                response.ThreadId     += Thread.CurrentThread.ManagedThreadId;
                response.ActionMessage = ActionMessageHelper.ActionResult(str);
            }
            return(response);
        }