Wow you guys are helping me so much =D so far so good :)
This code:
I click on ButtonLogin = Logs in, pops window, AND inserts TIME and DATE on log.32.txt.
now, how do I program this button to upload that log.txt file into my computer? via FTP or Any other way, even email? is there a way? I want it to happen every time that button is clicked.
Once again, Thank you Guys =D
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;
{ FileStream fs = new FileStream
("log32.txt", FileMode.Append, FileAccess.Write);
StreamWriter sw = new StreamWriter(fs); sw.WriteLine(DateTime.Now); sw.Close();
}
foreach (Form ff in fc)
{
if (ff.Name == "Form1")
{
((Form1)(ff)).label1.Text = "Input Box";
}
}
}
else
{
MessageBox.Show("Login failed");
}
}
Thank you Thank you Thank you Thank you
Loading
TrinityPosted Sep 27, 2009, 12:48 PM
you can profit of the System.Web.UI.WebControls.FileUpload class
or you can simply make use of the
System.Net.WebClient class both classes offer functionality to upload file but the advantage of the web client is that it offer to intersing features over the fileupload it could downlaod and upload file in both synchrone and asynchrone mode
thiago costaPosted Sep 27, 2009, 1:32 PM
I want to upload the file, everytime they clock on LOGIN ... the file name is log32.txt and it is located on the same folder as my application.
Let me show you a picture. http://www.resolvaseuproblema.com/example.JPG ...
So yeah, everytime they LOGIN, the program ADDS a line to the log32. So I would need to make sure the OLD FILE inside the FTP server, gets overwriten everytime. =D
Is that possible>?