Autor Beitrag
gerhard_68
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Mo 16.08.10 10:32 
Hallo,

um die Funktion Sipsak auszuführen gebe ich folgende Zeile in der Eingabeaufforderung ein.

sipsak-0.9.5.exe","-T -vvv -M -B Dies ist ein Test vom 11.08.2010 -c sip:100@192.168.1.13 -s sip:06506225019@192.168.1.31");

Der Text "Dies ist ein Test vom 11.08.2010" wird korrekt verschickt.

Ich rufe folgende Funktion mit c# auf:

ausblenden C#-Quelltext
1:
Process.Start("c:\\sipsak-0.9.5.exe","-T -vvv -M -B Dies ist ein Test vom 11.08.2010 -c sip:100@192.168.1.13 -s sip:06506225019@192.168.1.31");					

Es wird nur der Text "Dies" verschickt!!

Auch dieser Aufruf funktioniert nicht
ausblenden C#-Quelltext
1:
Process.Start("c:\\sipsak-0.9.5.exe","-T -vvv -M -B"+" Dies ist ein Test vom 11.08.2010"+" -c sip:100@192.168.1.13 -s sip:06506225019@192.168.1.31");					




Wer kann mir weiterhelfen?

LG

Gerhard

Moderiert von user profile iconChristian S.: C#-Tags hinzugefügt
Ralf Jansen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 4708
Erhaltene Danke: 991


VS2010 Pro, VS2012 Pro, VS2013 Pro, VS2015 Pro, Delphi 7 Pro
BeitragVerfasst: Mo 16.08.10 11:46 
Um ein " in einem string zu escapen brauchst du 2 davon also "". In deinem zweiten gezeigten Process.Start Aufruf solltest du einfach mal das + weglassen.
gerhard_68 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Mo 16.08.10 12:13 
Hallo,

danke für die Antwort, habe es probiert, geht leider nicht!



ausblenden C#-Quelltext
1:
Process.Start("c:\\sipsak-0.9.5.exe""-T -vvv -M -B"  " Dies ist ein Test vom 11.08.2010"  " -c sip:100@192.168.1.13 -s sip:06506225019@192.168.1.31")					

geht nicht
ausblenden C#-Quelltext
1:
Process.Start("c:\\sipsak-0.9.5.exe""-T -vvv -M -B" , " Dies ist ein Test vom 11.08.2010"  ," -c sip:100@192.168.1.13 -s sip:06506225019@192.168.1.31");					

geht auch nicht!

Vielleicht hat noch jemand einen Vorschlage

Moderiert von user profile iconChristian S.: C#-Tags hinzugefügt
Greenberet
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 339
Erhaltene Danke: 20

Win 10
C# (VS 2012), C++ (VS 2012/GCC), PAWN(Notepad++), Java(NetBeans)
BeitragVerfasst: Mo 16.08.10 12:42 
ausblenden C#-Quelltext
1:
Process.Start("c:\\sipsak-0.9.5.exe","-T -vvv -M -B \"Dies ist ein Test vom 11.08.2010\" -c sip:100@192.168.1.13 -s sip:06506225019@192.168.1.31");					


btw. Danke für deine Handynummer
gerhard_68 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Mo 16.08.10 14:57 
Danke, jetzt gehts!!
gerhard_68 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Mo 16.08.10 15:21 
Noch eine Frage, wie bekomme ich den Inhalt einer Textbox in den Funktionsaufruf?

ausblenden C#-Quelltext
1:
2:
3:
4:
string i=Textbox1.ToString();


Process.Start("c:\\sipsak-0.9.5.exe","-T -vvv -M -B \"i\" -c sip:100@192.168.1.13 -s sip:06506225019@192.168.1.31"); // Der String wird so nicht erkannt!


Moderiert von user profile iconChristian S.: C#-Tags hinzugefügt
gerhard_68 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Mo 16.08.10 16:23 
Ich habe es mit der Insert Methode geschafft!!


string hge = ("-T -vvv -M -B \"\" -c sip:100@192.168.1.13 -s sip:06506225019@192.168.1.31");
hge = hge.Insert(15, textBox1.Text.ToString());


Process sipsak = new Process();
sipsak.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
sipsak.StartInfo.FileName = "c:\\sipsak-0.9.5.exe";
sipsak.StartInfo.Arguments = hge;
sipsak.Start();
Ralf Jansen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 4708
Erhaltene Danke: 991


VS2010 Pro, VS2012 Pro, VS2013 Pro, VS2015 Pro, Delphi 7 Pro
BeitragVerfasst: Mo 16.08.10 16:39 
Üblicherweise würde man eher string.Format dafür verwenden.

ausblenden C#-Quelltext
1:
string hge = string.Format("-T -vvv -M -B \"{0}\" -c sip:100@192.168.1.13 -s sip:06506225019@192.168.1.31", textBox1.Text);					
gerhard_68 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Di 17.08.10 08:39 
Du hast recht, Danke!