Repository navigation
Expand file tree
/
Copy pathCall_Program.cs
More file actions
72 lines (70 loc) · 2.98 KB
/
Copy pathCall_Program.cs
File metadata and controls
72 lines (70 loc) · 2.98 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using System.Diagnostics;
namespace moja_baza
{
static class Call_Program
{
public static void CallKalkulator()
{
var psi = new ProcessStartInfo
{
//Jeśli mścieżka do pliku nie jest wpisana, to umieść wywoływany program w tym msamym katalogu co Call_Program.exe
// FileName = @"c:\work\test.exe",
FileName = @"kalkulator.exe",
Arguments = @"param1 param2",
UseShellExecute = false,
RedirectStandardOutput = true,
};
var process = Process.Start(psi);
if (process.WaitForExit((int)TimeSpan.FromSeconds(10).TotalMilliseconds))
{
var result = process.StandardOutput.ReadToEnd();
Console.WriteLine(result);
}
}
public static void CallJitsi()
{
var psi = new ProcessStartInfo
{
//Jeśli mścieżka do pliku nie jest wpisana, to umieść wywoływany program w tym msamym katalogu co Call_Program.exe
// FileName = @"c:\work\test.exe",
// FileName = @"C:\\Program Files\\Mozilla Firefox\\firefox.exe",
//Wywołuję msedge, gdyż firefox i inne niektóre przegladarki nie obsługują wirtualnych kamer bez odpowiednich wtyczek. Nie wiem jakie wtyczki są potrzebne do firefow
FileName = @"C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
Arguments = @" --new-window --app=https://meet.jit.si/ciekawe_projekty",
// Arguments = @"C:\Baza\index.html",
UseShellExecute = false,
RedirectStandardOutput = true,
};
var process = Process.Start(psi);
if (process.WaitForExit((int)TimeSpan.FromSeconds(10).TotalMilliseconds))
{
var result = process.StandardOutput.ReadToEnd();
Console.WriteLine(result);
}
}
public static void CallProgram(String filename)
{
var psi = new ProcessStartInfo
{
//Jeśli mścieżka do pliku nie jest wpisana, to umieść wywoływany program w tym msamym katalogu co Call_Program.exe
// FileName = @"c:\work\test.exe",
FileName = @filename,
// FileName = @"kalkulator.exe",
Arguments = @"param1 param2",
UseShellExecute = false,
RedirectStandardOutput = true,
};
var process = Process.Start(psi);
if (process.WaitForExit((int)TimeSpan.FromSeconds(10).TotalMilliseconds))
{
var result = process.StandardOutput.ReadToEnd();
Console.WriteLine(result);
}
}
public static void GoToSite(string url)
{
System.Diagnostics.Process.Start(url);
}
}
}