Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.Net.Mail;
- using System.IO;
- namespace Maplestory_Account_tool
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- public string id; //Maple ID
- public string pw; //Maple Password
- public string pin; //Maple Pin
- public string accemail; //Mail of the Maplestory account
- public string email; //Your email
- public string emailpw; //Password of your email
- public string name; //Your name
- public string lastname; //Your last name
- public string year; //Year of birth
- public string month; // Month of birth
- public string day; //Day of birth
- public string gender; //Your gender
- public void WriteHTML()
- {
- //writes the {account name}.html file
- using (StreamWriter writer = new StreamWriter("C:\\maplestoryAccounts/" + id + ".html"))
- {
- writer.WriteLine("<html>");
- writer.WriteLine("<body>");
- writer.WriteLine("<center><h1>Maplestory account : " + id + "</h1></center>");
- // <Username>
- writer.WriteLine("<CENTER><table BORDER = 1 WIDTH = 325>");
- writer.WriteLine("<CENTER><h3>Maplestory ID:<h3></CENTER>");
- writer.WriteLine("<tr>");
- writer.WriteLine("<td><CENTER>" + id + "</CENTER></td>");
- writer.WriteLine("</tr>");
- // </Username>
- //-----------------------------------------------------------------
- // <Password>
- writer.WriteLine("<CENTER><h3>Password:<h3></CENTER></td>");
- writer.WriteLine("<tr>");
- writer.WriteLine("<td><CENTER>" + pw + "</CENTER></td>");
- writer.WriteLine("</tr>");
- // </Password>
- //-----------------------------------------------------------------
- // <PIN>
- writer.WriteLine("<CENTER><h3>PIN : <h3></CENTER></td>");
- writer.WriteLine("<tr>");
- writer.WriteLine("<td><CENTER>" + pin + "</CENTER></td>");
- writer.WriteLine("</tr>");
- // </PIN>
- //-----------------------------------------------------------------
- // <Email>
- writer.WriteLine("<CENTER><h3>Email : <h3></CENTER></td>");
- writer.WriteLine("<tr>");
- writer.WriteLine("<td><CENTER>" + accemail + "</CENTER></td>");
- writer.WriteLine("</tr>");
- // </Email>
- //-----------------------------------------------------------------
- // <First Name>
- writer.WriteLine("<CENTER><h3>First Name : <h3></CENTER></td>");
- writer.WriteLine("<tr>");
- writer.WriteLine("<td><CENTER>" + name + "</CENTER></td>");
- writer.WriteLine("</tr>");
- // </First Name>
- //-----------------------------------------------------------------
- // <Last Name>
- writer.WriteLine("<CENTER><h3>Last Name : <h3></CENTER></td>");
- writer.WriteLine("<tr>");
- writer.WriteLine("<td><CENTER>" + lastname + "</CENTER></td>");
- writer.WriteLine("</tr>");
- // </Last Name>
- //-----------------------------------------------------------------
- // <Birthday>
- writer.WriteLine("<CENTER><h3>Birthday <yyyy-mm-dd> : <h3></CENTER></td>");
- writer.WriteLine("<tr>");
- writer.WriteLine("<td><CENTER>" + year + "-" + month + "-" + day + "</CENTER></td>");
- writer.WriteLine("</tr>");
- // </Birthday>
- //-----------------------------------------------------------------
- // <Gender>
- writer.WriteLine("<CENTER><h3>Gender : <h3></CENTER></td>");
- writer.WriteLine("<tr>");
- writer.WriteLine("<td><CENTER>" + gender + "</CENTER></td>");
- writer.WriteLine("</tr>");
- // </Gender>
- writer.WriteLine("</body>");
- writer.WriteLine("</html>");
- }
- }
- private void btnSend_Click(object sender, EventArgs e)
- {
- try
- {
- // Assigns the values of the textboxes to the variables
- id = txtID.Text;
- pw = txtPass.Text;
- pin = txtPin.Text;
- email = txtMail.Text;
- emailpw = txtEmailPass.Text;
- accemail = txtYourEmail.Text;
- name = txtName.Text;
- lastname = txtLastName.Text;
- year = cmbYear.Text;
- month = cmbMonth.Text;
- day = cmbDay.Text;
- // Checks if the directory excists, if yes : Write file
- if (Directory.Exists("C:\\maplestoryAccounts"))
- {
- MessageBox.Show("File written to C:\\maplestoryAccounts");
- WriteHTML();
- }
- else
- {
- // if directory doesn't excist : Create Directory and write file
- Directory.CreateDirectory("C:\\maplestoryAccounts");
- MessageBox.Show("Directory created and file written to C:\\maplestoryAccounts");
- WriteHTML();
- }
- MailMessage mail = new MailMessage();
- SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
- // it sends the email from itself to itself
- mail.From = new MailAddress(email);
- mail.To.Add(email);
- mail.Subject = "Maplestory account info of : " + txtID.Text;
- mail.IsBodyHtml = true;
- string htmlBody;
- // body of the email + HTML
- htmlBody = ("<html>" +
- "<body>" +
- "<center><h1>Maplestory account info : " + id + "</h1></center>" +
- "<CENTER><table BORDER = 1 WIDTH = 325>" +
- "<CENTER><h3>Maplestory ID:<h3></CENTER>" +
- "<tr>" +
- "<td><CENTER>" + id + "</CENTER></td>" +
- "</tr>");
- mail.Body = htmlBody;
- System.Net.Mail.Attachment attachment;
- attachment = new System.Net.Mail.Attachment("C:\\maplestoryAccounts\\" + id + ".html");
- mail.Attachments.Add(attachment);
- // SMTP Port - 587
- SmtpServer.Port = 587;
- // This gets your email and password
- SmtpServer.Credentials = new System.Net.NetworkCredential(email, emailpw);
- SmtpServer.EnableSsl = true;
- SmtpServer.Send(mail);
- MessageBox.Show("The information has been sent to : " + email);
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.ToString());
- }
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- MessageBox.Show("Only GMAIL accounts are supported now" + Environment.NewLine + Environment.NewLine + "Benjamin");
- }
- private void radioButton1_CheckedChanged(object sender, EventArgs e)
- {
- //Variable Gender gets the value : "Male"
- gender = "Male";
- }
- private void radioButton2_CheckedChanged(object sender, EventArgs e)
- {
- // Variable Gender gets the value : "Female"
- gender = "female";
- }
- }
- }
Add Comment
Please, Sign In to add comment