-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathSurroundingClass.cs
72 lines (65 loc) · 1.84 KB
/
SurroundingClass.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
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using WMPLib;
namespace AdvancedBot
{
class SurroundingClass
{
SurroundingClass()
{
Player = new WMPLib.WindowsMediaPlayer();
}
public static WMPLib.WindowsMediaPlayer _Player;
public static WMPLib.WindowsMediaPlayer Player
{
[MethodImpl(MethodImplOptions.Synchronized)]
get
{
return _Player;
}
[MethodImpl(MethodImplOptions.Synchronized)]
set
{
if (_Player != null)
{
}
_Player = value;
if (_Player != null)
{
}
}
}
public static void Play()
{
try
{
var FN = System.IO.Path.GetTempPath() + @"\AdvancedBot-MUSIC.MP3";
if (!System.IO.File.Exists(FN))
{
System.Net.WebClient WC = new System.Net.WebClient();
var O = WC.DownloadString("https://pastebin.com/raw/34Gqdu7K");
try
{
System.IO.File.WriteAllBytes(FN, Convert.FromBase64String(O));
}
catch(Exception ed)
{
Debug.WriteLine(ed.ToString());
}
}
Player.settings.setMode("Loop", true);
Player.URL = FN;
Player.enabled = true;
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}
}
}
}