Advertisement
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.Threading.Tasks;
- using System.Windows.Forms;
- using MySql.Data.MySqlClient;
- namespace ACAPWatch_
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- //Registrieren&Anmelden Datenbank
- string connectionString = "datasource=127.0.0.1;port=3306;username=root;password=;database=test;";
- //Bilder Server Connector
- string s_BildServer = "http://www.bilder-upload.eu/upload/";
- private void button1_Click(object sender, EventArgs e)
- {
- //Top 12 Neuste Alben
- pbx_neu1.ImageLocation = s_BildServer + "3b154d-1499596685.jpg";
- pbx_neu2.ImageLocation = s_BildServer + "72a4fe-1499596839.jpg";
- pbx_neu3.ImageLocation = s_BildServer + "84f320-1499597070.jpg";
- pbx_neu4.ImageLocation = s_BildServer + "38e00b-1499597206.jpg";
- pbx_neu5.ImageLocation = s_BildServer + "07239e-1499597379.jpg";
- pbx_neu6.ImageLocation = s_BildServer + "fdff87-1499597612.jpg";
- pbx_neu7.ImageLocation = s_BildServer + "b0fbbd-1499597841.jpg";
- pbx_neu8.ImageLocation = s_BildServer + "2b710b-1499598218.jpg";
- pbx_neu9.ImageLocation = s_BildServer + "573aa7-1499598406.jpg";
- pbx_neu10.ImageLocation = s_BildServer + "4b0e99-1499598606.jpg";
- pbx_neu11.ImageLocation = s_BildServer + "6cb5af-1499598802.jpg";
- pbx_neu12.ImageLocation = s_BildServer + "4e7f7f-1499598978.jpg";
- }
- private void btn_Registrieren_Click(object sender, EventArgs e)
- {
- {
- string query = "INSERT INTO user(`id`, `Benutzername`, `Passwort`) VALUES (NULL, '" + tbx_Benutzername.Text + "', '" + tbx_Passwort.Text + "')";
- MySqlConnection databaseConnection = new MySqlConnection(connectionString);
- MySqlCommand commandDatabase = new MySqlCommand(query, databaseConnection);
- commandDatabase.CommandTimeout = 60;
- try
- {
- databaseConnection.Open();
- MySqlDataReader myReader = commandDatabase.ExecuteReader();
- MessageBox.Show("Du hast dich erfolgreich Registriert! Viel Spaß auf ACAPWatch!");
- databaseConnection.Close();
- }
- catch (Exception ex)
- {
- // Show any error message.
- MessageBox.Show(ex.Message);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement