-
Notifications
You must be signed in to change notification settings - Fork 1
/
Configs.cs
75 lines (73 loc) · 1.31 KB
/
Configs.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
73
74
75
/*
* Creado por SharpDevelop.
* Usuario: GNR092
* Fecha: 06/02/2017
* Hora: 08:04 p.m.
*
* Para cambiar esta plantilla use Herramientas | Opciones | Codificación | Editar Encabezados Estándar
*/
using System;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
namespace SecureGameGuard
{
/// <summary>
/// SecureGameGuard.
///
/// Copyright (C) GNR092, 2016-2017.
/// </summary>
[Serializable]
public class Configs
{
public string List
{
get;
set;
}
public void save()
{
Stream stream = null;
try
{
stream = File.Open(Directory.GetCurrentDirectory() + "\\Config.bin", FileMode.Create);
BinaryFormatter formater = new BinaryFormatter();
formater.Serialize(stream, this);
}
catch (Exception)
{
}
finally
{
if (stream != null)
{
stream.Close();
}
}
}
public void load()
{
Configs Cnf = null;
Stream stream = null;
try
{
stream = File.Open(Directory.GetCurrentDirectory() + "\\Config.bin", FileMode.Open);
BinaryFormatter formater = new BinaryFormatter();
Cnf = (Configs)formater.Deserialize(stream);
if (Cnf != null)
{
List = Cnf.List;
}
}
catch (Exception)
{
}
finally
{
if (stream != null)
{
stream.Close();
}
}
}
}
}