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 System.Net;
- using System.Net.Sockets;
- using System.IO;
- using System.Collections.Specialized;
- using System.Threading;
- namespace WindowsFormsApplication6
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void sendbutton_Click(object sender, EventArgs e)
- {
- }
- private void Login_Click(object sender, EventArgs e)
- {
- if (Username.Text == "")
- {
- MessageBox.Show("Please enter your Username");
- }
- else
- {
- if (Password.Text == "")
- {
- MessageBox.Show("Please enter your Password");
- }
- else
- {
- if (email.Text == "")
- {
- MessageBox.Show("Please enter your Email");
- }
- else
- {
- string uriString = ("http://thedevspot.xyz:90/user/insert");
- WebClient myWebClient = new WebClient();
- NameValueCollection myNameValueCollection = new NameValueCollection();
- string user = Username.Text;
- string pass = Password.Text;
- string mail = email.Text;
- string avatar = null;
- myNameValueCollection.Add("username", user);
- myNameValueCollection.Add("password", pass);
- myNameValueCollection.Add("email", mail);
- myNameValueCollection.Add("avatar", avatar);
- try
- {
- Console.WriteLine("\nUploading to {0} ...", uriString);
- byte[] responseArray = myWebClient.UploadValues(uriString, myNameValueCollection);
- Console.WriteLine("\nResponse received was :{0}", Encoding.ASCII.GetString(responseArray));
- MessageBox.Show("You successfully logged in!");
- wlcm.Text = ("Wellcome " + user + "!");
- }
- catch {
- Console.WriteLine("{0} exceptipm caught", e);
- MessageBox.Show("Error, try again");
- }
- }
- }
- }
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement