Hello there, I have a code below, ... When you click on that BUTTON(the code button) I would like to be able to INSERT
TIME , DATE , and IP, into a TEXT file, into the next empty line, with out deleting what was inside of the text file, and then, upload that text file somewhere, .... I am going to give this software to about 14 people, and I would like to log each time they log in to it. Any other ideas? if not, how do I do this? ...
Thank you in advance for your help.
private void buttonLogin_Click(object sender, EventArgs e)
{
string password = textBoxPassword.Text;
if (SQLDataAccess.ValidateConnection("Account", password) == true)
{
SQLDataAccess.Password = password;
MessageBox.Show("Login Successful");
textBoxPassword.Text = "";
textBoxPassword.UseSystemPasswordChar = false;
FormCollection fc = Application.OpenForms;
foreach (Form ff in fc)
{
if (ff.Name == "Form1")
{
((Form1)(ff)).label1.Text = "Input Box";
}
}
}
else
{
MessageBox.Show("Login failed");
}
}
Loading
jingePosted Sep 27, 2009, 6:05 AM
thiago costaPosted Sep 27, 2009, 1:22 PM
From now on I will not forget. I am so sorry.
And thank you once again.
thiago costaPosted Sep 27, 2009, 3:40 AM
Here is the code: static void Main(string[] args) { FileStream fs = new FileStream("log.txt", FileMode.Append, FileAccess.Write); StreamWriter sw = new StreamWriter(fs); sw.WriteLine("append me"); sw.Close(); }
That method worked very well with my code =D Thank you Lots.
Thank you all !
Roei BarPosted Sep 27, 2009, 2:39 AM
Roei BarPosted Sep 27, 2009, 2:35 AM
jingePosted Sep 26, 2009, 11:08 PM