-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
41 lines (32 loc) · 1 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// See https://aka.ms/new-console-template for more information
using System;
using System.Collections.Generic;
using SteamCMD.ConPTY;
using SteamCMD.ConPTY.Interop.Definitions;
var arguments = new List<string>()
{
"@ShutdownOnFailedCommand 1",
"@sSteamCmdForcePlatformType linux",
"+force_install_dir D:\\new\\templates\\aaa\\836e773a-dd0f-426c-94ea-b939abe78540",
"+login anonymous",
"+app_update 740",
"+quit"
};
var steamCMDConPTY = new SteamCMDConPTY
{
Arguments = string.Join(' ', arguments),
//WorkingDirectory = Path.Combine(Environment.CurrentDirectory, "steamcmd"),
//FilterControlSequences = true,
};
steamCMDConPTY.TitleReceived += (sender, data) => { };
steamCMDConPTY.OutputDataReceived += (sender, data) =>
{
Console.WriteLine(data);
};
steamCMDConPTY.Exited += (sender, exitCode) =>
{
};
ProcessInfo processInfo = steamCMDConPTY.Start();
// Get SteamCMD PID by ProcessInfo
Console.WriteLine(processInfo.dwProcessId);
Console.WriteLine("Hello, World!");