-
Notifications
You must be signed in to change notification settings - Fork 0
/
can_use_port.xaml.cs
60 lines (55 loc) · 1.67 KB
/
can_use_port.xaml.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Net;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Forms;
using System.Text.Json;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using Microsoft.WindowsAPICodePack.Dialogs;
using System.Text;
using System.Net.Sockets;
using System.Management;
using System.Threading;
using CoreRCON;
using SteamQueryNet.Interfaces;
namespace ark_server_utility
{
/// <summary>
/// can_use_port.xaml の相互作用ロジック
/// </summary>
public partial class can_use_port : Window
{
public int port = MainWindow.port;
public can_use_port()
{
InitializeComponent();
}
private void open_help_port(object sender, RoutedEventArgs e)
{
MainWindow.OpenUrl("https://nattyan-tv.github.io/ark-server-utility/note/port");
}
private void check_port(object sender, RoutedEventArgs e)
{
// IPC通信を開始するためのポート検索するスクリプトを実行する
var ipc_port = new Process
{
StartInfo = new ProcessStartInfo("python/search_port.exe")
{
Arguments = "2",
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true
}
};
ipc_port.Start();
StreamReader ports = ipc_port.StandardOutput;
util_log.Text = ports.ReadLine();
ipc_port.WaitForExit();
ipc_port.Close();
}
}
}