public static string CHeading(string path) { string text = Lib.File_ReadToEnd("C:\\home\\hidemaru\\template\\c_heading_001.txt"); if (File.Exists(path)) { try { string newValue = path.Replace("F:", "http://localhost").Replace("\\", "/"); text = text.Replace("%%FILEEXT%%", Path.GetExtension(path)).Replace(".", ""); text = text.Replace("%%FILENAME%%", Path.GetFileName(path)); text = text.Replace("%%FILEPATH%%", path); text = text.Replace("%%LOCALURL%%", newValue); text = text.Replace("%%TIMESTAMP%%", StringHandler.timestamp()); } catch (Exception ex) { string message = ex.Message.ToString(); MessageBox.Show(Lib.OutputError(message)); return(ex.Message.ToString()); } return(text); } return(text); }
public static string File_GetEofCode(string filepath) { string text = Lib.File_ReadToEnd(filepath); if (!File.Exists(filepath)) { return(null); } if (text.IndexOf("\r\n") >= 0) { return("CRLF"); } if (text.IndexOf("\r") >= 0) { return("CR"); } if (text.IndexOf("\n") >= 0) { return("LR"); } return(""); }