/// <summary>
/// 將文件轉換成字符串
/// </summary>
/// <param name="path"></param>
/// <param name="isSpace"></param>
/// <returns></returns>
public static string GetTempleContent(string path)
{
string result = string.Empty;
string sFileName = HttpContext.Current.Server.MapPath(path);
if (File.Exists(sFileName))
{
try
{
using (StreamReader sr = new StreamReader(sFileName))
{
result = sr.ReadToEnd();
}
}
catch
{
result = "讀取模板文件(" + path + ")出錯";
}
}
else
{
result = "找不到模板文件:" + path;
}
return result;
}
將文件轉換成字符串
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.