-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNews.cs
157 lines (138 loc) · 4.59 KB
/
News.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/*
Copyright (C) 2004 SensePost Research
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
//using System.Drawing;
/*using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Text;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using SensePost.Wikto.com.google.api;
using System.Xml;
using System.Text.RegularExpressions;*/
using Microsoft.Win32;
//using Org.Mentalis.Security.Ssl;
//using Org.Mentalis.Security.Certificates;
namespace SensePost.Wikto
{
public partial class News : Form
{
private frm_Wikto g_form;
public News(frm_Wikto theform)
{
InitializeComponent();
this.g_form = theform;
if (g_form.bl_ShowStart)
chk_ShowStart.Checked = true;
else
chk_ShowStart.Checked = false;
if (g_form.bl_ShowStartWiz)
chk_StartWiz.Checked = true;
else
chk_StartWiz.Checked = false;
}
private void btn_NewsClose_Click(object sender, EventArgs e)
{
this.Dispose();
}
public void setshowstartreg(bool ShowTheForm)
{
//now we have to write the filename location to the registry
RegistryKey OurKey = Registry.LocalMachine;
OurKey = OurKey.OpenSubKey("SOFTWARE", true);
OurKey.CreateSubKey("SensePost");
OurKey.CreateSubKey(@"SensePost\Wikto");
RegistryKey NewKey = Registry.LocalMachine;
NewKey = NewKey.OpenSubKey(@"SOFTWARE\SensePost\Wikto", true);
try
{
if (ShowTheForm)
{
NewKey.SetValue("ShowStart", "1");
}
else
{
NewKey.SetValue("ShowStart", "0");
}
}
catch (Exception ex)
{
MessageBox.Show("Problems writing to registry:\n\n" + ex.ToString());
}
NewKey.Close();
}
public void setwizstartreg(bool ShowTheForm)
{
//now we have to write the filename location to the registry
RegistryKey OurKey = Registry.LocalMachine;
OurKey = OurKey.OpenSubKey("SOFTWARE", true);
OurKey.CreateSubKey("SensePost");
OurKey.CreateSubKey(@"SensePost\Wikto");
RegistryKey NewKey = Registry.LocalMachine;
NewKey = NewKey.OpenSubKey(@"SOFTWARE\SensePost\Wikto", true);
try
{
if (ShowTheForm)
{
NewKey.SetValue("ShowWizard", "1");
}
else
{
NewKey.SetValue("ShowWizard", "0");
}
}
catch (Exception ex)
{
MessageBox.Show("Problems writing to registry:\n\n" + ex.ToString());
}
NewKey.Close();
}
private void chk_ShowStart_CheckedChanged(object sender, EventArgs e)
{
if (chk_ShowStart.Checked)
{
setshowstartreg(true);
}
else
{
setshowstartreg(false);
}
}
private void News_Load(object sender, EventArgs e)
{
}
private void chk_StartWiz_CheckedChanged(object sender, EventArgs e)
{
if (chk_StartWiz.Checked)
{
setwizstartreg(true);
}
else
{
setwizstartreg(false);
}
}
}
}