diff --git a/App.config b/App.config
index 7251b5a..5c15716 100644
--- a/App.config
+++ b/App.config
@@ -4,9 +4,6 @@
-
-
-
@@ -16,10 +13,6 @@
1
-
-
-
-
1
@@ -27,5 +20,5 @@
1
-
+
\ No newline at end of file
diff --git a/CreateXml.cs b/CreateXml.cs
new file mode 100644
index 0000000..cbf6c16
--- /dev/null
+++ b/CreateXml.cs
@@ -0,0 +1,119 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Xml.Linq;
+
+namespace XDocument_Sample
+{
+ class CreateXml
+ {
+ string file = "xml.xml";
+
+ public CreateXml(string xml) {
+
+ XDocument doc =
+ new XDocument(
+ new XElement("file",
+ new XElement("name", new XAttribute("filename", "sample")),
+ new XElement("date", new XAttribute("modified", DateTime.Now), new XAttribute("hallo", "dsd")),
+
+ // From here the CA Section
+ new XElement("CA",
+ new XElement("name", "Sample-CA"),
+ new XElement("type", "CA"),
+ new XElement("id", "0"),
+ new XElement("Private",
+ new XElement("Bits", "4096"),
+ new XElement("Pass", "passwortca"),
+ new XElement("file", "Sample-CA.key.pem")
+ ),
+ new XElement("Public",
+ new XElement("duration", "7300"),
+ new XElement("pass", "passwortca"),
+ new XElement("cnf", "openssl-ca.cnf"),
+ new XElement("subj",
+ new XElement("C", "DE"),
+ new XElement("ST", "Bavaria"),
+ new XElement("L", "Hausen"),
+ new XElement("OU", "IT"),
+ new XElement("CN", "Lang-CA"),
+ new XElement("email", "admin@admin.de")
+ )
+ )
+ ),
+ // From here the Intermediate Section
+ new XElement("Intermediate",
+ new XElement("name", "Sample-Intermediate"),
+ new XElement("type", "Intermediate"),
+ new XElement("id", "1"),
+ new XElement("Private",
+ new XElement("Bits", "4096"),
+ new XElement("pass", "passwortint")
+ ),
+ new XElement("CSR",
+ new XElement("cnf", "openssl-int.cnf"),
+ new XElement("pass_priv", "passwortint"),
+ new XElement("subj",
+ new XElement("C", "DE"),
+ new XElement("ST", "Bavaria"),
+ new XElement("L", "Hausen"),
+ new XElement("OU", "IT"),
+ new XElement("CN", "Lang-Intermediate"),
+ new XElement("email", "admin@admin.de")
+ )
+ ),
+ new XElement("Sign",
+ new XElement("cnf-ca", "openssl-ca.cnf"),
+ new XElement("duration", "3650"),
+ new XElement("CA",
+ new XElement("id", "0"),
+ new XElement("passCa", "passwordca")
+ )
+ )
+ ),
+ // From here server section
+ new XElement("Server",
+ new XElement("name", "Sample-Server"),
+
+ new XElement("type", "Server"),
+ new XElement("id", "1"),
+ new XElement("Private",
+
+ new XElement("Bits", "4096"),
+ new XElement("pass", "")
+ ),
+ new XElement("CSR",
+ new XElement("pass_priv", ""),
+ new XElement("subj",
+ new XElement("C", "DE"),
+ new XElement("ST", "Bavaria"),
+ new XElement("L", "Hausen"),
+ new XElement("OU", "IT"),
+ new XElement("CN", "Lang-Server"),
+ new XElement("email", "admin@admin.de")
+ ),
+ new XElement("SAN",
+ new XElement("DNS.1", "SAN"),
+ new XElement("IP.1", "192.168.1.1")
+ )
+ ),
+ new XElement("Sign",
+ new XElement("cnf", "openssl-int.cnf"),
+ new XElement("duration", "365"),
+ new XElement("passInt", "passwordint"),
+ new XElement("Intermediate",
+ new XElement("id", "1"),
+ new XElement("passInt", "passwordint")
+ )
+ )
+ )
+ )
+ );
+
+ doc.Save(xml);
+
+ }
+ }
+}
diff --git a/Form1.Designer.cs b/Form1.Designer.cs
index 3019d37..ccf3abf 100644
--- a/Form1.Designer.cs
+++ b/Form1.Designer.cs
@@ -29,76 +29,70 @@ protected override void Dispose(bool disposing)
private void InitializeComponent()
{
textBox1 = new TextBox();
- button1 = new Button();
- button2 = new Button();
- button3 = new Button();
- button4 = new Button();
- button5 = new Button();
+ bt_clist_write = new Button();
+ bt_delete = new Button();
+ createXml = new Button();
+ replaceClick = new Button();
textBox2 = new TextBox();
textBox3 = new TextBox();
- listBox1 = new ListBox();
- button6 = new Button();
+ lb_caliste = new ListBox();
+ addServerXml = new Button();
+ id = new TextBox();
+ type = new TextBox();
+ textBox6 = new TextBox();
+ textBox7 = new TextBox();
+ findServer = new Button();
SuspendLayout();
//
// textBox1
//
- textBox1.Location = new Point(45, 72);
+ textBox1.Location = new Point(45, 20);
textBox1.Name = "textBox1";
textBox1.Size = new Size(100, 23);
textBox1.TabIndex = 0;
//
- // button1
- //
- button1.Location = new Point(260, 75);
- button1.Name = "button1";
- button1.Size = new Size(75, 23);
- button1.TabIndex = 1;
- button1.Text = "write";
- button1.UseVisualStyleBackColor = true;
- button1.Click += button1_Click;
- //
- // button2
- //
- button2.Location = new Point(260, 114);
- button2.Margin = new Padding(2);
- button2.Name = "button2";
- button2.Size = new Size(76, 20);
- button2.TabIndex = 2;
- button2.Text = "search";
- button2.UseVisualStyleBackColor = true;
- button2.Click += button2_Click;
- //
- // button3
- //
- button3.Location = new Point(260, 147);
- button3.Name = "button3";
- button3.Size = new Size(75, 23);
- button3.TabIndex = 3;
- button3.Text = "replace";
- button3.UseVisualStyleBackColor = true;
- button3.Click += button3_Click;
- //
- // button4
- //
- button4.Location = new Point(474, 72);
- button4.Margin = new Padding(2);
- button4.Name = "button4";
- button4.Size = new Size(129, 23);
- button4.TabIndex = 4;
- button4.Text = "create xml.xml";
- button4.UseVisualStyleBackColor = true;
- button4.Click += Createxml_Click;
- //
- // button5
- //
- button5.Location = new Point(479, 126);
- button5.Margin = new Padding(2);
- button5.Name = "button5";
- button5.Size = new Size(153, 24);
- button5.TabIndex = 5;
- button5.Text = "replace entry with textbox";
- button5.UseVisualStyleBackColor = true;
- button5.Click += Replace_Click;
+ // bt_clist_write
+ //
+ bt_clist_write.Location = new Point(46, 50);
+ bt_clist_write.Name = "bt_clist_write";
+ bt_clist_write.Size = new Size(75, 23);
+ bt_clist_write.TabIndex = 1;
+ bt_clist_write.Text = "write";
+ bt_clist_write.UseVisualStyleBackColor = true;
+ bt_clist_write.Click += bt_clist_write_Click;
+ //
+ // bt_delete
+ //
+ bt_delete.Location = new Point(45, 84);
+ bt_delete.Margin = new Padding(2);
+ bt_delete.Name = "bt_delete";
+ bt_delete.Size = new Size(76, 20);
+ bt_delete.TabIndex = 2;
+ bt_delete.Text = "delete";
+ bt_delete.UseVisualStyleBackColor = true;
+ bt_delete.Click += Bt_delete_Click;
+ //
+ // createXml
+ //
+ createXml.Location = new Point(474, 72);
+ createXml.Margin = new Padding(2);
+ createXml.Name = "createXml";
+ createXml.Size = new Size(129, 23);
+ createXml.TabIndex = 4;
+ createXml.Text = "create xml.xml";
+ createXml.UseVisualStyleBackColor = true;
+ createXml.Click += Createxml_Click;
+ //
+ // replaceClick
+ //
+ replaceClick.Location = new Point(479, 126);
+ replaceClick.Margin = new Padding(2);
+ replaceClick.Name = "replaceClick";
+ replaceClick.Size = new Size(153, 24);
+ replaceClick.TabIndex = 5;
+ replaceClick.Text = "replace entry with textbox";
+ replaceClick.UseVisualStyleBackColor = true;
+ replaceClick.Click += Replace_Click;
//
// textBox2
//
@@ -117,39 +111,85 @@ private void InitializeComponent()
textBox3.TabIndex = 7;
textBox3.Text = "grafana";
//
- // listBox1
+ // lb_caliste
//
- listBox1.FormattingEnabled = true;
- listBox1.ItemHeight = 15;
- listBox1.Location = new Point(123, 260);
- listBox1.Name = "listBox1";
- listBox1.Size = new Size(120, 94);
- listBox1.TabIndex = 8;
+ lb_caliste.FormattingEnabled = true;
+ lb_caliste.ItemHeight = 15;
+ lb_caliste.Location = new Point(45, 140);
+ lb_caliste.Name = "lb_caliste";
+ lb_caliste.Size = new Size(120, 94);
+ lb_caliste.TabIndex = 8;
//
- // button6
+ // addServerXml
//
- button6.Location = new Point(479, 164);
- button6.Name = "button6";
- button6.Size = new Size(75, 23);
- button6.TabIndex = 9;
- button6.Text = "add server to xml";
- button6.UseVisualStyleBackColor = true;
- button6.Click += AddServer_Click;
+ addServerXml.Location = new Point(479, 164);
+ addServerXml.Name = "addServerXml";
+ addServerXml.Size = new Size(75, 23);
+ addServerXml.TabIndex = 9;
+ addServerXml.Text = "add server to xml";
+ addServerXml.UseVisualStyleBackColor = true;
+ addServerXml.Click += AddServer_Click;
+ //
+ // id
+ //
+ id.Location = new Point(576, 247);
+ id.Margin = new Padding(2);
+ id.Name = "id";
+ id.Size = new Size(104, 23);
+ id.TabIndex = 10;
+ //
+ // type
+ //
+ type.Location = new Point(576, 276);
+ type.Margin = new Padding(2);
+ type.Name = "type";
+ type.Size = new Size(104, 23);
+ type.TabIndex = 11;
+ //
+ // textBox6
+ //
+ textBox6.Location = new Point(576, 308);
+ textBox6.Margin = new Padding(2);
+ textBox6.Name = "textBox6";
+ textBox6.Size = new Size(104, 23);
+ textBox6.TabIndex = 12;
+ //
+ // textBox7
+ //
+ textBox7.Location = new Point(576, 336);
+ textBox7.Margin = new Padding(2);
+ textBox7.Name = "textBox7";
+ textBox7.Size = new Size(104, 23);
+ textBox7.TabIndex = 13;
+ //
+ // findServer
+ //
+ findServer.Location = new Point(479, 193);
+ findServer.Name = "findServer";
+ findServer.Size = new Size(75, 23);
+ findServer.TabIndex = 14;
+ findServer.Text = "find server";
+ findServer.UseVisualStyleBackColor = true;
+ findServer.Click += FindServer_Click;
//
// Form1
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
- Controls.Add(button6);
- Controls.Add(listBox1);
+ Controls.Add(findServer);
+ Controls.Add(textBox7);
+ Controls.Add(textBox6);
+ Controls.Add(type);
+ Controls.Add(id);
+ Controls.Add(addServerXml);
+ Controls.Add(lb_caliste);
Controls.Add(textBox3);
Controls.Add(textBox2);
- Controls.Add(button5);
- Controls.Add(button4);
- Controls.Add(button3);
- Controls.Add(button2);
- Controls.Add(button1);
+ Controls.Add(replaceClick);
+ Controls.Add(createXml);
+ Controls.Add(bt_delete);
+ Controls.Add(bt_clist_write);
Controls.Add(textBox1);
Name = "Form1";
Text = "Form1";
@@ -161,14 +201,18 @@ private void InitializeComponent()
#endregion
private TextBox textBox1;
- private Button button1;
- private Button button2;
- private Button button3;
- private Button button4;
- private Button button5;
+ private Button bt_clist_write;
+ private Button bt_delete;
+ private Button createXml;
+ private Button replaceClick;
private TextBox textBox2;
private TextBox textBox3;
- private ListBox listBox1;
- private Button button6;
+ private ListBox lb_caliste;
+ private Button addServerXml;
+ private TextBox id;
+ private TextBox type;
+ private TextBox textBox6;
+ private TextBox textBox7;
+ private Button findServer;
}
}
diff --git a/Form1.cs b/Form1.cs
index 1285836..44b4822 100644
--- a/Form1.cs
+++ b/Form1.cs
@@ -1,7 +1,4 @@
-using System.Configuration;
-using System.IO;
using System.Xml.Linq;
-using System.Xml.XPath;
namespace XDocument_Sample
{
@@ -10,184 +7,209 @@ public partial class Form1 : Form
readonly string file = "Sample.xml";
readonly string xml = @"xml.xml";
+ private string caliste = @"listen\ca-liste.txt";
+ string interliste = @"listen\inter-liste.txt";
+ string serverliste = @"listen\server-liste.txt";
+ string userliste = @"listen\user-liste.txt";
int CAident = Properties.Settings.Default.CAID;
int Intident = Properties.Settings.Default.InterID;
int Servident = Properties.Settings.Default.ServerID;
int Usrident = Properties.Settings.Default.UserID;
+ ///
+ /// reads the CA-List
+ ///
+ /// clears upfront the listBox
+ public void Cblist_read(bool refreshList)
+ {
+ using (StreamReader sr = new StreamReader(caliste))
+ {
+ if (refreshList)
+ {
+ lb_caliste.Items.Clear();
+ }
+ while (true)
+ {
+ string line = sr.ReadLine();
+ if (line == null)
+ {
+ break;
+ }
+ lb_caliste.Items.Add(line); // Use line.
+ }
+ }
+ lb_caliste.Sorted = true;
+ }
public Form1()
{
InitializeComponent();
}
- private void button1_Click(object sender, EventArgs e)
+ private void bt_clist_write_Click(object sender, EventArgs e)
{
- try
- {
- XDocument doc =
- new XDocument(
- new XElement("file",
- new XElement("name2", "sample12"),
- new XElement("CA", "CA_Name"),
-
- new XElement("name")
+ if (!lb_caliste.Items.Cast().Contains(textBox1.Text))
- )
- );
-
- doc.Save("Sample.xml");
- }
- catch (Exception ex)
{
- MessageBox.Show("Fehler bei Debugoutput", ex.Message, MessageBoxButtons.OK);
-
+ MessageBox.Show("no duplicate");
}
+ else
+ {
+ MessageBox.Show("duplicate");
+ return;
+ };
+ StreamWriter sw = new StreamWriter(caliste, true);
+ sw.WriteLine(textBox1.Text);
+ sw.Close();
+
+ Cblist_read(true);
}
-
private void Form1_Load(object sender, EventArgs e)
{
+ Cblist_read(false);
- XDocument doc =
- new XDocument(
- new XElement("file",
- new XElement("name", new XAttribute("filename", "sample")),
- new XElement("date", new XAttribute("modified", DateTime.Now), new XAttribute("hallo", "dsd")),
-
- // From here the CA Section
- new XElement("CA",
- new XElement("name", "Sample-CA"),
- new XElement("type", "CA"),
- new XElement("id", "0"),
- new XElement("Private",
- new XElement("Bits", "4096"),
- new XElement("Pass", "passwortca"),
- new XElement("file", "Sample-CA.key.pem")
- ),
- new XElement("Public",
- new XElement("duration", "7300"),
- new XElement("pass", "passwortca"),
- new XElement("cnf", "openssl-ca.cnf"),
- new XElement("subj",
- new XElement("C", "DE"),
- new XElement("ST", "Bavaria"),
- new XElement("L", "Hausen"),
- new XElement("OU", "IT"),
- new XElement("CN", "Lang-CA"),
- new XElement("email", "admin@admin.de")
- )
- )
- ),
- // From here the Intermediate Section
- new XElement("Intermediate",
- new XElement("name", "Sample-Intermediate"),
- new XElement("type", "Intermediate"),
- new XElement("id", "1"),
- new XElement("Private",
- new XElement("Bits", "4096"),
- new XElement("pass", "passwortint")
- ),
- new XElement("CSR",
- new XElement("cnf", "openssl-int.cnf"),
- new XElement("pass_priv", "passwortint"),
- new XElement("subj",
- new XElement("C", "DE"),
- new XElement("ST", "Bavaria"),
- new XElement("L", "Hausen"),
- new XElement("OU", "IT"),
- new XElement("CN", "Lang-Intermediate"),
- new XElement("email", "admin@admin.de")
- )
- ),
- new XElement("Sign",
- new XElement("cnf-ca", "openssl-ca.cnf"),
- new XElement("duration", "3650"),
- new XElement("CA",
- new XElement("id", "0"),
- new XElement("passCa", "passwordca")
- )
+ bool v = true;
+ if (v)
+ {
+ XDocument doc =
+ new XDocument(
+ new XElement("file",
+ new XElement("name", new XAttribute("filename", "sample")),
+ //new XElement("date", new XAttribute("modified", DateTime.Now)),
+
+ // From here the CA Section
+ new XElement("Sample-CA",
+ //new XElement("name","Sample-CA"),
+ //new XAttribute("Name", "TestPL"),
+ new XElement("type", "CA"),
+ new XElement("id", "0"),
+ new XElement("Private",
+ new XElement("Bits", "4096"),
+ new XElement("Pass", "passwortca"),
+ new XElement("file", "Sample-CA.key.pem")
+ ),
+ new XElement("Public",
+ new XElement("duration", "7300"),
+ new XElement("pass", "passwortca"),
+ new XElement("cnf", "openssl-ca.cnf"),
+ new XElement("subj",
+ new XElement("C", "DE"),
+ new XElement("ST", "Bavaria"),
+ new XElement("L", "Hausen"),
+ new XElement("OU", "IT"),
+ new XElement("CN", "Lang-CA"),
+ new XElement("email", "admin@admin.de")
+ )
)
- ),
- // From here server section
- new XElement("Server",
- new XElement("name", "Sample-Server"),
-
- new XElement("type", "Server"),
- new XElement("id", "1"),
- new XElement("Private",
+ //)
+ ),
- new XElement("Bits", "4096"),
- new XElement("pass", "")
+ // From here the Intermediate Section
+ new XElement("Intermediate",
+ new XElement("name", "Sample-Intermediate"),
+ new XElement("type", "Intermediate"),
+ new XElement("id", "1"),
+ new XElement("Private",
+ new XElement("Bits", "4096"),
+ new XElement("pass", "passwortint")
),
- new XElement("CSR",
- new XElement("pass_priv", ""),
- new XElement("subj",
- new XElement("C", "DE"),
- new XElement("ST", "Bavaria"),
- new XElement("L", "Hausen"),
- new XElement("OU", "IT"),
- new XElement("CN", "Lang-Server"),
- new XElement("email", "admin@admin.de")
- ),
- new XElement("SAN",
- new XElement("DNS.1", "SAN"),
- new XElement("IP.1", "192.168.1.1")
- )
- ),
- new XElement("Sign",
- new XElement("cnf", "openssl-int.cnf"),
- new XElement("duration", "365"),
- new XElement("passInt", "passwordint"),
- new XElement("Intermediate",
- new XElement("id", "1"),
- new XElement("passInt", "passwordint")
+ new XElement("CSR",
+ new XElement("cnf", "openssl-int.cnf"),
+ new XElement("pass_priv", "passwortint"),
+ new XElement("subj",
+ new XElement("C", "DE"),
+ new XElement("ST", "Bavaria"),
+ new XElement("L", "Hausen"),
+ new XElement("OU", "IT"),
+ new XElement("CN", "Lang-Intermediate"),
+ new XElement("email", "admin@admin.de")
+ )
+ ),
+ new XElement("Sign",
+ new XElement("cnf-ca", "openssl-ca.cnf"),
+ new XElement("duration", "3650"),
+ new XElement("CA",
+ new XElement("id", "0"),
+ new XElement("passCa", "passwordca")
+ )
+ )
+ ),
+ // From here server section
+ new XElement("Server",
+ new XElement("name", "Sample-Server"),
+
+ new XElement("type", "Server"),
+ new XElement("id", "1"),
+ new XElement("Private",
+
+ new XElement("Bits", "4096"),
+ new XElement("pass", "")
+ ),
+ new XElement("CSR",
+ new XElement("pass_priv", ""),
+ new XElement("subj",
+ new XElement("C", "DE"),
+ new XElement("ST", "Bavaria"),
+ new XElement("L", "Hausen"),
+ new XElement("OU", "IT"),
+ new XElement("CN", "Lang-Server"),
+ new XElement("email", "admin@admin.de")
+ ),
+ new XElement("SAN",
+ new XElement("DNS.1", "SAN"),
+ new XElement("IP.1", "192.168.1.1")
+ )
+ ),
+ new XElement("Sign",
+ new XElement("cnf", "openssl-int.cnf"),
+ new XElement("duration", "365"),
+ new XElement("passInt", "passwordint"),
+ new XElement("Intermediate",
+ new XElement("id", "1"),
+ new XElement("passInt", "passwordint")
+ )
)
)
- )
- )
- );
+ )
+ );
- doc.Save(xml);
+ doc.Save(xml);
+ }
}
- private void button2_Click(object sender, EventArgs e)
- {
- XDocument doc = XDocument.Load("Sample.xml");
- //IEnumerable elements = doc.Root.Elements("name");
- //foreach (XElement element in elements)
- //{
- // // Process each element here
- // MessageBox.Show(element.ToString(), "name", MessageBoxButtons.OK);
- //}
- XElement element = doc.Root.Element("data");
- MessageBox.Show(element.ToString(), "name", MessageBoxButtons.OK);
- }
+ //private void button2_Click(object sender, EventArgs e)
+ //{
+ // XDocument doc = XDocument.Load("Sample.xml");
+ // //IEnumerable elements = doc.Root.Elements("name");
+ // //foreach (XElement element in elements)
+ // //{
+ // // // Process each element here
+ // // MessageBox.Show(element.ToString(), "name", MessageBoxButtons.OK);
+ // //}
+ // XElement element = doc.Root.Element("data");
+ // MessageBox.Show(element.ToString(), "name", MessageBoxButtons.OK);
+ //}
- private void button3_Click(object sender, EventArgs e)
- {
+ //private void button3_Click(object sender, EventArgs e)
+ //{
- //var doc = XElement.Load(file);
- //var saveGame = doc
- // .Element("file")
- // .Elements("server")
- // .Where(e => e.Element("name").Value == "Docker")
- // .Single();
+ // //var doc = XElement.Load(file);
+ // //var saveGame = doc
+ // // .Element("file")
+ // // .Elements("server")
+ // // .Where(e => e.Element("name").Value == "Docker")
+ // // .Single();
- //saveGame.Element("duration").Value = "50";
+ // //saveGame.Element("duration").Value = "50";
- //doc.Save(file);
+ // //doc.Save(file);
- XDocument xmlDocument = XDocument.Load(file);
- XElement elementToReplace = xmlDocument.Descendants("name").FirstOrDefault();
- elementToReplace.Value = "NewValue";
- xmlDocument.Save(file);
+ // XDocument xmlDocument = XDocument.Load(file);
+ // XElement elementToReplace = xmlDocument.Descendants("name").FirstOrDefault();
+ // elementToReplace.Value = "NewValue";
+ // xmlDocument.Save(file);
- }
-
- public void CaXml()
- {
-
- }
+ //}
private void Createxml_Click(object sender, EventArgs e)
{
@@ -200,7 +222,7 @@ private void Createxml_Click(object sender, EventArgs e)
// From here the CA Section
new XElement("CA",
- new XElement("name", "Sample-CA"),
+ new XElement("Sample-CA",
new XElement("type", "CA"),
new XElement("id", "0"),
new XElement("Private",
@@ -221,6 +243,7 @@ private void Createxml_Click(object sender, EventArgs e)
new XElement("email", "admin@admin.de")
)
)
+ )
),
// From here the Intermediate Section
new XElement("Intermediate",
@@ -323,7 +346,7 @@ private void Replace_Click(object sender, EventArgs e)
private void AddServer_Click(object sender, EventArgs e)
{
-
+
XDocument doc = XDocument.Load(xml);
doc.Root.Element("CA").Add(
new XElement("name", "Sample-CA"),
@@ -351,7 +374,52 @@ private void AddServer_Click(object sender, EventArgs e)
doc.Save(xml);
}
-
+ private void Bt_delete_Click(object sender, EventArgs e)
+ {
+ string line;
+ string line_to_delete = lb_caliste.SelectedItem.ToString();
+ string calistetmp = "caliste.tmp";
+
+ try
+ {
+ using (StreamReader reader = new StreamReader(caliste))
+ {
+ using (StreamWriter writer = new StreamWriter(calistetmp))
+ {
+ while ((line = reader.ReadLine()) != null)
+ {
+ if (String.Compare(line, line_to_delete) == 0)
+ continue;
+
+ writer.WriteLine(line);
+ }
+ }
+ }
+ File.Move(calistetmp, caliste);
+ File.Delete(calistetmp);
+ Cblist_read(true);
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.ToString(), sender.ToString());
+
+
+ }
+ }
+
+ private void FindServer_Click(object sender, EventArgs e)
+ {
+ string tmpselection = lb_caliste.Items[0].ToString();
+
+ XDocument doc = XDocument.Load("xml.xml");
+ IEnumerable ca = doc.Descendants(tmpselection);
+ foreach (XElement cas in ca)
+ {
+ id.Text = cas.Element("id").Value;
+ type.Text = cas.Element("type").Value;
+ }
+
+ }
}
-}
+}
\ No newline at end of file
diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs
index 85b04c4..2cb0403 100644
--- a/Properties/Settings.Designer.cs
+++ b/Properties/Settings.Designer.cs
@@ -41,28 +41,22 @@ public int InterID {
}
}
- [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1")]
public int ServerID {
get {
return ((int)(this["ServerID"]));
}
- set {
- this["ServerID"] = value;
- }
}
- [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1")]
public int UserID {
get {
return ((int)(this["UserID"]));
}
- set {
- this["UserID"] = value;
- }
}
}
}
diff --git a/Properties/Settings.settings b/Properties/Settings.settings
index 336f00d..09d28af 100644
--- a/Properties/Settings.settings
+++ b/Properties/Settings.settings
@@ -8,10 +8,10 @@
1
-
+
1
-
+
1
diff --git a/XDocument_Sample.csproj b/XDocument_Sample.csproj
index 8807d1c..4161552 100644
--- a/XDocument_Sample.csproj
+++ b/XDocument_Sample.csproj
@@ -8,55 +8,4 @@
enable
-
-
- True
- True
- Resources.resx
-
-
- True
- True
- Settings.settings
-
-
- True
- True
- Settings1.settings
-
-
- True
- True
- variables.settings
-
-
-
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
-
-
-
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
- Always
-
-
- SettingsSingleFileGenerator
- Settings1.Designer.cs
-
-
- SettingsSingleFileGenerator
- variables.Designer.cs
-
-
- Never
-
-
-
\ No newline at end of file
diff --git a/XDocument_Sample.csproj.bak b/XDocument_Sample.csproj.bak
new file mode 100644
index 0000000..c32602b
--- /dev/null
+++ b/XDocument_Sample.csproj.bak
@@ -0,0 +1,84 @@
+
+
+
+ WinExe
+ net8.0-windows
+ enable
+ true
+ enable
+
+ True
+
+
+
+ False
+
+
+
+ True
+
+
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ True
+ Settings.settings
+
+
+ True
+ True
+ Settings1.settings
+
+
+ True
+ True
+ variables.settings
+
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ Never
+
+
+ SettingsSingleFileGenerator
+ Settings1.Designer.cs
+
+
+ SettingsSingleFileGenerator
+ variables.Designer.cs
+
+
+ Never
+
+
+
+
\ No newline at end of file
diff --git a/XDocument_Sample.csproj.user b/XDocument_Sample.csproj.user
index b020096..457b0c4 100644
--- a/XDocument_Sample.csproj.user
+++ b/XDocument_Sample.csproj.user
@@ -1,5 +1,6 @@
+
Form
diff --git a/XDocument_Sample.sln b/XDocument_Sample.sln
index 4555784..ef96e22 100644
--- a/XDocument_Sample.sln
+++ b/XDocument_Sample.sln
@@ -1,9 +1,9 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
-VisualStudioVersion = 17.8.34322.80
+VisualStudioVersion = 17.11.35222.181
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XDocument_Sample", "XDocument_Sample\XDocument_Sample.csproj", "{E8474839-3101-450F-9F4B-211C310D3C69}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XDocument_Sample", "XDocument_Sample.csproj", "{4E33F534-9B3E-42DC-9A70-8EC02CCDCDC7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -11,15 +11,15 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {E8474839-3101-450F-9F4B-211C310D3C69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E8474839-3101-450F-9F4B-211C310D3C69}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E8474839-3101-450F-9F4B-211C310D3C69}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E8474839-3101-450F-9F4B-211C310D3C69}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4E33F534-9B3E-42DC-9A70-8EC02CCDCDC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4E33F534-9B3E-42DC-9A70-8EC02CCDCDC7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4E33F534-9B3E-42DC-9A70-8EC02CCDCDC7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4E33F534-9B3E-42DC-9A70-8EC02CCDCDC7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {10C6E628-A2A8-40F8-89B6-FC04BDDC0C5D}
+ SolutionGuid = {93110E0D-9D46-4375-A738-68C315367FFC}
EndGlobalSection
EndGlobal
diff --git a/listen/ca-liste.txt b/listen/ca-liste.txt
new file mode 100644
index 0000000..58590d9
--- /dev/null
+++ b/listen/ca-liste.txt
@@ -0,0 +1 @@
+Sample-CA
\ No newline at end of file
diff --git a/listen/inter-liste.txt b/listen/inter-liste.txt
new file mode 100644
index 0000000..e69de29
diff --git a/listen/server-liste.txt b/listen/server-liste.txt
new file mode 100644
index 0000000..e69de29
diff --git a/listen/user-liste.txt b/listen/user-liste.txt
new file mode 100644
index 0000000..e69de29
diff --git a/test.snippet b/test.snippet
new file mode 100644
index 0000000..b905856
--- /dev/null
+++ b/test.snippet
@@ -0,0 +1,31 @@
+
+
+
+
+
+ PATRICK-RECHNER\Patri
+
+
+
+ Expansion
+
+
+
+
+ mbex
+
+
+
+
+
+
+ ex.ToString()
+ fsadfsadfsa
+ ex.ToString()
+
+
+
+
+
+
+
\ No newline at end of file