linking information between forms C# (Textboxes)

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<span style="font-family:Verdana,sans-serif; font-size:9pt Hi, have no<br/>
idea how to get information from my textbox in form 1 to my form 2 so that i<br/>
can save combine it and save it. Any help would be appreciated.
<span style="font-family:Verdana,sans-serif; font-size:9pt Here is my<br/>
code, if you could specify where i should change private to public or set a<br/>
{get ; set} function, or string it... really have no idea. Thanks in advance.
(Coding in C#, Windows 7, <span style="line-height:115%; font-family:Verdana,sans-serif; font-size:9pt
Microsoft visual studio)
<br/>

Form 1s Code:
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System;
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System.Collections.Generic;
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System.ComponentModel;
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System.Data;
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System.Drawing;
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System.Linq;
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System.Text;
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System.Windows.Forms;
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System.IO;
<p style="line-height:normal; margin-bottom:0pt
<p style="line-height:normal; margin-bottom:0pt
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt namespace<span style="font-family:Consolas; font-size:9.5pt Geni
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt {
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue public <span style="color:blue partial<span style="color:blue class
<span style="color:#2b91af Form1 : <span style="color:#2b91af Form
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue public Form1()
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
InitializeComponent();
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue private <span style="color:blue void exitbtn_Click(<span style="color:blue object sender,<span style="color:#2b91af EventArgs e)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue this.Close();
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue public <span style="color:blue void generatebtn_Click(<span style="color:blue object sender,<span style="color:#2b91af EventArgs e)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
textBox1.Clear();
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue char[] numans = { <span style="color:#a31515
0, <span style="color:#a31515 1, <span style="color:#a31515 2,<span style="color:#a31515 3,
<span style="color:#a31515 4, <span style="color:#a31515 5, <span style="color:#a31515
6, <span style="color:#a31515 7,<span style="color:#a31515 8,
<span style="color:#a31515 9, };
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue char[] letans = { <span style="color:#a31515
A, <span style="color:#a31515 B, <span style="color:#a31515 C,<span style="color:#a31515 D,
<span style="color:#a31515 E, <span style="color:#a31515 F, <span style="color:#a31515
G, <span style="color:#a31515 H,<span style="color:#a31515 I,
<span style="color:#a31515 J, <span style="color:#a31515 K, <span style="color:#a31515
L, <span style="color:#a31515 M,<span style="color:#a31515 N,
<span style="color:#a31515 O, <span style="color:#a31515 P, <span style="color:#a31515
Q, <span style="color:#a31515 R,<span style="color:#a31515 S,
<span style="color:#a31515 T, <span style="color:#a31515 U, <span style="color:#a31515
V, <span style="color:#a31515 W,<span style="color:#a31515 X,
<span style="color:#a31515 Y, <span style="color:#a31515 Z };
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue char[] all = { <span style="color:#a31515
0, <span style="color:#a31515 1, <span style="color:#a31515 2,<span style="color:#a31515 3,
<span style="color:#a31515 4, <span style="color:#a31515 5, <span style="color:#a31515
6, <span style="color:#a31515 7,<span style="color:#a31515 8,
<span style="color:#a31515 9, <span style="color:#a31515 A, <span style="color:#a31515
B, <span style="color:#a31515 C,<span style="color:#a31515 D,
<span style="color:#a31515 E, <span style="color:#a31515 F, <span style="color:#a31515
G, <span style="color:#a31515 H,<span style="color:#a31515 I,
<span style="color:#a31515 J, <span style="color:#a31515 K, <span style="color:#a31515
L, <span style="color:#a31515 M,<span style="color:#a31515 N,
<span style="color:#a31515 O, <span style="color:#a31515 P, <span style="color:#a31515
Q, <span style="color:#a31515 R,<span style="color:#a31515 S,
<span style="color:#a31515 T, <span style="color:#a31515 U, <span style="color:#a31515
V, <span style="color:#a31515 W,<span style="color:#a31515 X,
<span style="color:#a31515 Y, <span style="color:#a31515 Z };
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:#2b91af Random r = <span style="color:blue new<span style="color:#2b91af Random();
<p style="line-height:normal; margin-bottom:0pt
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue if (checkBoxlet.Checked == <span style="color:blue
false && checkBoxnum.Checked == <span style="color:blue false)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:#2b91af MessageBox.Show(<span style="color:#a31515 "Please select what should be generated by ticking numbers, letters or both.");
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span> }
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue else
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue if (checkBoxnum.Checked && checkBoxlet.Checked)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue try
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue for (<span style="color:blue int i = 0; i <<span style="color:blue int.Parse(comboBoxnum.Text); i++)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
textBox1.Text += all[r.Next(0, all.Length)].ToString();
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue catch
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span>
<span style="color:#2b91af MessageBox.Show(<span style="color:#a31515 "Please select how many charecters sould be generated");
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue else <span style="color:blue if (checkBoxlet.Checked)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue try
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue for (<span style="color:blue int i = 0; i <<span style="color:blue int.Parse(comboBoxnum.Text); i++)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
textBox1.Text += letans[r.Next(0, letans.Length)].ToString();
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue catch
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:#2b91af MessageBox.Show(<span style="color:#a31515 "Please select how many charecters sould be generated");
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span> }
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue else <span style="color:blue if (checkBoxnum.Checked)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue try
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue for (<span style="color:blue int i = 0; i <<span style="color:blue int.Parse(comboBoxnum.Text); i++)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span>
textBox1.Text += numans[r.Next(0, numans.Length)].ToString();
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue catch
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:#2b91af MessageBox.Show(<span style="color:#a31515 "Please select how many charecters sould be generated");
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>

<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue private <span style="color:blue void helpToolStripMenuItem_Click(<span style="color:blue object sender,<span style="color:#2b91af EventArgs e)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:#2b91af MessageBox.Show(<span style="color:#a31515 "Call or E-mail J.J. Pienaar for assistance (Integritron)");
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue private <span style="color:blue void exitToolStripMenuItem_Click(<span style="color:blue object sender,<span style="color:#2b91af EventArgs e)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue this.Close();
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue private <span style="color:blue void comboBoxnum_SelectedIndexChanged(<span style="color:blue object sender,<span style="color:#2b91af EventArgs e)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>

<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue public <span style="color:blue void savebtn_Click(<span style="color:blue object sender,<span style="color:#2b91af EventArgs e)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>

<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue if (textBox1.Text.Length == 0)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:#2b91af MessageBox.Show(<span style="color:#a31515 "Please generate before saving");
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue else
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:#2b91af CustomMsgBox formcustommsgbox = <span style="color:blue
new <span style="color:#2b91af CustomMsgBox();
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
formcustommsgbox.Show();
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue public <span style="color:blue void textBox1_TextChanged(<span style="color:blue object sender,<span style="color:#2b91af EventArgs e)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>

<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt }
<p style="line-height:normal; margin-bottom:0pt
<p style="line-height:normal; margin-bottom:0pt -------------------------------------------------------------------------------------------------------------------------------------
<p style="line-height:normal; margin-bottom:0pt
<p style="line-height:normal; margin-bottom:0pt Form 2s code:
<p style="line-height:normal; margin-bottom:0pt
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System;
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System.Collections.Generic;
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System.ComponentModel;
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System.Data;
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System.Drawing;
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System.Linq;
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System.Text;
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System.Windows.Forms;
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt using<span style="font-family:Consolas; font-size:9.5pt System.IO;
<p style="line-height:normal; margin-bottom:0pt
<p style="line-height:normal; margin-bottom:0pt <span style="color:blue; font-family:Consolas; font-size:9.5pt namespace<span style="font-family:Consolas; font-size:9.5pt Geni
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt {
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue public <span style="color:blue partial<span style="color:blue class
<span style="color:#2b91af CustomMsgBox :<span style="color:#2b91af Form
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue public CustomMsgBox()
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
InitializeComponent();
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue private <span style="color:blue void savebtn_Click(<span style="color:blue object sender,<span style="color:#2b91af EventArgs e)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue if (saveastextBox.Text.Length >= 1)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue string tempFile = <span style="color:#2b91af
Environment.GetFolderPath(<span style="color:#2b91af Environment.<span style="color:#2b91af SpecialFolder.Desktop) +<span style="color:#a31515 "\Password.txt";
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue if (!<span style="color:#2b91af File.Exists(tempFile))
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
System.IO.<span style="color:#2b91af File.WriteAllText(tempFile, saveastextBox.Text);
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue else
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
System.IO.<span style="color:#2b91af File.AppendAllText(tempFile, <span style="color:#a31515
"rn" + saveastextBox.Text) ;
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span style="color:blue else <span style="color:#2b91af MessageBox.Show(<span style="color:#a31515 "Please save the generated key under a name");
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<span> <span style="color:blue private<span style="color:blue void CustomMsgBox_Load(<span style="color:blue object sender,<span style="color:#2b91af EventArgs e)
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
{
<p style="line-height:normal; margin-bottom:0pt
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
}
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt }

View the full article
 

Similar threads

D
Replies
0
Views
97
Donald Uko
D
A
Replies
0
Views
158
ANIL AYDINALP
A
K
Replies
0
Views
220
Khan345
K
R
Replies
0
Views
130
Ravnø Data
R
Back
Top