如何从C#运行.exe

编程入门 行业动态 更新时间:2024-10-26 14:39:17
本文介绍了如何从C#运行.exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在用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

本文发布于:2023-07-05 07:54:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1034893.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:exe

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!