using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SimplePEMCalculator { class clsConvert { private string FilePath, OutputPath, WinSCPPath; public clsConvert(string fpath, string opath, string ppath) { FilePath = fpath; OutputPath = opath; WinSCPPath = ppath; } public int doConvert() { //try conversion try { System.Diagnostics.Process process = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; startInfo.FileName = WinSCPPath + "\\" + "winscp.com"; //forming the ouput file by getting the input filename and adding the current date string outputfile = FilePath.Substring(FilePath.LastIndexOf("\\") + 1) + ".ppk" ; string op = OutputPath + "\\"+outputfile; startInfo.Arguments = "/keygen " + FilePath + " -o " + op; process.StartInfo = startInfo; process.Start(); process.Close(); return 1; } catch { return 0; } } } }
System.IO.Path
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)