简体   繁体   English

调用C#中的一个程序 Program using VisualStudio

[英]Calling a program in C# Program using VisualStudio

I made a CMD program that can convert the photos from Png to SVG format.我做了一个 CMD 程序,可以将照片从 Png 格式转换为 SVG 格式。 how can I call this program in a C# program?如何在 C# 程序中调用该程序?

the Photo Path is:照片路径是:

    `var path = @"C:\Users\";

    var sourcePath = Path.Combine(path, @"emoji1.png");

    var destPath = Path.Combine(path, @"png01.svg");`

i would like to open my cmd Photo converter Program in other C# Program`我想在其他 C# 程序中打开我的 cmd 照片转换器程序`

var arguments = ""; //optional, if your cmd converter can accept path to photo as an argument - you can put it here
var proc = Process.Start("path to executable", arguments);
proc.WaitForExit();// if you need to work in sync with that app

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM