如何使用gnokii和vb.net发送Multiline短信

时间:2013-12-18 05:22:20

标签: vb.net gnokii

亲爱的所有我试图使用gnikii发送多行短信但它失败了

 Dim xCmd As String
    xCmd = "cmd.exe /c echo " & txtBody.Text & " | c:\sms\gnokii.exe --sendsms 0771234567 2> test.txt"
    Shell(xCmd)

请帮帮我

1 个答案:

答案 0 :(得分:0)

您可以在vbCrLf上拆分文本并在前面添加回显,这样就最终得到了这个cmdline

cmd.exe / c lineOne echo line2 | c:\ sms \ gnokii.exe --sendsms 0771234567 2>的test.txt

代码明智,你可以这样做:

    Dim sString As String 
    Dim aLines As String()
    Dim xCmd As String

    sString = "lineOne" & vbCrLf & "line2"
    aLines = sString.Split(vbCrLf)
    sString = Join(aLines," echo")

    xCmd = "cmd.exe /c " & sString & " | c:\sms\gnokii.exe --sendsms 0771234567 2> test.txt"
    Shell(xCmd)