/// <summary>
/// 传参数调用外部exe程序
/// </summary>
/// <param name="exeFullPath"></param>
/// <param name="param"></param>
public void CallExe(string exeFullPath, string param)
{
//string exePath = "D:\\aaa\\bbb\\";
//string exeFileName = "123.exe";
//string exeFullPath = exePath + exeFileName;
Process proexe = Process.Start(exeFullPath, param);
}
? ? ? 链接:
????????GitHub - JoshClose/CsvHelper: Library to help reading and writing CSV files
? ? ? ? Examples | CsvHelperExamples | CsvHelperExamples | CsvHelper
? ? ? ? 步骤:?
? ? ? ? ? ? ? ? 1> Nuget搜索安装CsvHelper
? ? ? ? ? ? ? ? 2> csv写入 - 参考官方示例:
void Main()
{
var records = new List<Foo>
{
new Foo { Id = 1, Name = "one" },
};
using (var writer = new StreamWriter("path\\to\\file.csv"))
using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture))
{
csv.WriteRecords(records);
}
}
public class Foo
{
public int Id { get; set; }
public string Name { get; set; }
}
输出:
Id,Name
1,one