我想使用gammu发送带有地址和消息的文本消息,但是gammu参数有问题。如果我只启动它运行的程序(string cmd1 = "c:\\G133\\bin\\gammu.exe ";)。在添加参数后,它会导致此失败:
System.ComponentModel.Win32Exception‘发生在System.dll中 其他信息:系统找不到指定的文件:
代码:
string[] sms = File.ReadAllLines(@"C:\\temp\\test.txt");
string address = sms[0];
string message = sms[1];
string cmd1 = @"C:\G133\bin\gammu.exe --sendsms TEXT" + " " +
"\"" + address + "\" -text " + " " + "\"" + message + "\"";
System.Diagnostics.Process.Start(cmd1);有谁可以帮我?提前谢谢。
产出看上去很好:
Console.WriteLine(cmd1); - result
C:\G133\bin\gammu.exe --sendsms TEXT +12121234567 -text "Hello"发布于 2016-06-13 11:59:04
您需要调用Start方法的重载,该方法接受两个参数:
它看起来就像:
string app = @"path\to\your\target\app";
string prms = "your parameters";
System.Diagnostics.Process.Start(app, prms);发布于 2016-06-13 11:57:42
您应该拆分应用程序和参数:
Process.Start(@"C:\G133\bin\gammu.exe", "--sendsms TEXT +12121234567 -text \"Hello\"");https://stackoverflow.com/questions/37789107
复制相似问题