private string NodeSqlFormatter(string sourceText)
{
Process p = new Process();
DirectoryInfo startUpPath = new DirectoryInfo(Application.StartupPath);
string[] delimiter = { "\\{{경로구분자}}" }; //경로 구분자
string path = startUpPath.ToString();
string[] paths = path.Split(delimiter, System.StringSplitOptions.RemoveEmptyEntries);
string filePath = string.Format(@"{0}{1}", paths[0], delimiter[0]);
string s;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.StandardOutputEncoding = Encoding.UTF8; //한글 깨지면 encoding 변경
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; //console 창 안보이기
p.StartInfo.CreateNoWindow = true; //console 창 안보이기
p.StartInfo.FileName = string.Format("C:\\Program Files\\nodejs\\node.exe"); //노드 실행 파일 경로
p.StartInfo.Arguments = string.Format("{0}\\{{js 파일명}} \"{1}\"", filePath, textBox1.Text);
p.Start();
StreamReader reader = p.StandardOutput;
StreamWriter writer = p.StandardInput;
writer.AutoFlush = true;
s = reader.ReadToEnd();
s = s.Replace("\n", "\r\n");
return s;
}
'Web_Application > C#' 카테고리의 다른 글
[mssql][winform][ado.net] SSMS 와 Application 에서 쿼리 실행 시간이 너무 많이 차이 날때 (0) | 2018.12.08 |
---|---|
[fpspread][winform][c#] currency 고정 소숫점 표시 유/무 (0) | 2018.12.08 |
[fpspread][c#] vb CopyRowRange -> c#CopyRange (0) | 2018.11.19 |
[fpspread][c#] spread lock (0) | 2018.11.19 |
[fpspread][c#] ToolTip 적용 (0) | 2018.11.12 |