Autor Beitrag
Geneesys
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36



BeitragVerfasst: Mo 16.01.12 18:13 
Hey,

Hoffe bin hier richtig und jemand kann mir helfen.

Jeder kennt Minecraft und man kann den Minecraft Server Ram mit einer Batchdatei erhöhen.

ausblenden Quelltext
1:
"C:\Program Files\Java\jre6\bin\javaw.exe" -Xmx2024M -Xms2024M -jar minecraft_server.exe					

Wie krieg ich diesen Code in meinen C# Script rein ?

Habe schon alles mögliche ausprobiert :/

Wenn man auf einen Button klickt soll sich halt der Minecraft Server mit der gewünschten anzahl (2GB) starten.

PS: bin in C# noch ein wenig neu.

MFG
Geneesys

Moderiert von user profile iconTh69: Code-Tags hinzugefügt
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4799
Erhaltene Danke: 1059

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Mo 16.01.12 19:38 
Hallo,

mit Hilfe der Process Klasse kannst du andere Anwendungen starten.
Die Parameter mußt du separat der Start()-Methode übergeben.
Geneesys Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36



BeitragVerfasst: Mo 16.01.12 20:11 
Danke für die schnelle Antwort!
Könntest du mir bitte mal ein Beispiel geben?
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4799
Erhaltene Danke: 1059

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Mo 16.01.12 20:40 
Hallo Geneesys,

dieses Forum orientiert sich an der "Hilfe zur Selbsthilfe". Hast du dir denn schon den Link zur MSDN angeschaut? Bei der erwähnten Start-Methode gibt es auch ein Beispiel.
Geneesys Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36



BeitragVerfasst: Mo 16.01.12 20:59 
Wie ich das starte ist klar.

Ich komme nur mit dem hinterem teil nicht klar.

-Xmx2024M -Xms2024M -jar minecraft_server.exe

Wie kann ich dem den sagen das er auch die javaw mit 2 GB Ram starten soll.

MFG
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4799
Erhaltene Danke: 1059

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Mo 16.01.12 21:06 
Hallo,

die Parameter einfach als 2. String der Start-Methode übergeben:
ausblenden C#-Quelltext
1:
Process.Start(@"...\javaw.exe""-...");					

P.S. Das @-Zeichen wegen dem Backslash (\), ansonsten werden diese als Sonder(Escape)-Zeichen interpretiert.
Geneesys Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36



BeitragVerfasst: Mo 16.01.12 21:17 
Danke dir

MFG
Geneesys