我正在用C#开发wpf应用程序.我在应用程序中使用grib文件.我想将此grib文件内容转换为csv文件.从命令提示符下,我可以轻松地做到这一点.对于此命令提示符,我需要转到degrib.exe的文件夹位置,即c:\ ndfd \ degrib \ bin.对于任何其他路径,命令将不会执行.我正在使用以下命令
I am developing wpf application in C#. I am using grib files in my application. I want to convert this grib file content into csv file. From command prompt I can easily do this. For this in command prompt I need to go to the folder location of degrib.exe i.e. c:\ndfd\degrib\bin. For any other path command will not get executed. I am using the following commands
C:\ndfd\degrib\bin\degrib D:\Documents\Pacificwind.grb -C -msg 1 -Csv C:\ndfd\degrib\bin\degrib D:\Documents\Pacificwind.grb -C -msg all -nMet -Csv命令成功执行.我可以在C:\ ndfd \ degrib \ bin文件夹中看到生成的csv文件.我应该如何从C#执行相同的命令.我看到了不同的示例,但没有一个对我有用.您能否提供任何可解决上述问题的代码或链接?
The commands get successfully executed. I am able to see generated csv files at C:\ndfd\degrib\bin folder. How should I execute the same command from C#. I have seen different examples but none of them worked for me. Can you please provide me any code or link through which I can resolve the above issue ?
推荐答案这将起作用,除非您提供的路径不正确:
This will work, unless the paths you provided are incorrect:
Process.Start(@"C:\ndfd\degrib\bin\degrib", @"D:\Documents\Pacificwind.grb -C -msg 1 -Csv"); Process.Start(@"C:\ndfd\degrib\bin\degrib", @"D:\Documents\Pacificwind.grb -C -msg all -nMet -Csv")更多推荐
如何从C#运行.exe
发布评论