Example #1
0
        /// <summary>
        /// 读取文本文件path的所有内容并返回。如果文件不存在,则抛出FileNotFoundException。
        /// </summary>
        /// <param name="path">路径</param>
        /// <param name="encoding">字符编码,可选,默认为utf-8</param>
        /// <returns></returns>
        public string read(string path, string encoding = "")
        {
            var p = this.path(path);

            if (string.IsNullOrWhiteSpace(encoding))
            {
                return(PFiles.Read(p));
            }

            return(PFiles.Read(p, encoding));
        }