I am using gnokii to send out SMSes.
My VB Codes:
Dim xCmd As String
xCmd = "cmd.exe /c echo msgcontent "| c:\gnokii\gnokii.exe --sendsms 12345678"
Shell(xCmd)
Points to note:
I did try to redirect the output to a .txt file but the .txt file appears to be empty. Besides, the program may have to send out multiple SMSes every second, so creating a .txt is not feasible.
Process.Start() is not feasible because I have to check if gnokii.exe is running.
I need the output to check if the SMS is sent successfully.
I tried using (codes below), but it didn't work either; no output was shown.
Function exe(ByVal fileName, ByVal args)
Dim p As Process = New Process Dim output As String With p .StartInfo.CreateNoWindow = True .StartInfo.UseShellExecute = False .StartInfo.RedirectStandardOutput = True .StartInfo.FileName = fileName .StartInfo.Arguments = args .Start() output = .StandardOutput.ReadToEnd End With Return output
End Function
To send output to a .txt file, (the best solution I can find)
REPLACE
WITH