本文介绍了如何删除“.pem”在文件名中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
晚上好,
如何删除文件名中的.pem以更改为.ppk
Good evening,
How do I remove the ".pem" in the filename to change to ".ppk"
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;
}
}
}
}
我尝试了什么:
我已经尝试了一些选项,并且出现空白且有错误。
再次感谢!
What I have tried:
I have tried some options and came up empty and with errors.
Thanks again!
推荐答案
这篇关于如何删除“.pem”在文件名中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!