-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsignup.aspx.cs
More file actions
103 lines (91 loc) · 3.32 KB
/
Copy pathsignup.aspx.cs
File metadata and controls
103 lines (91 loc) · 3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class signup : System.Web.UI.Page
{
Class1 con = new Class1();
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
TextBox2.Focus();
}
}
protected void Username_Changed(object sender, EventArgs e)
{
try
{
String s = TextBox1.Text;
if (s.Length >= 6)
{
DataSet ds = con.getdata("select * from Login_mst where User_Name='" + s + "'");
int result = ds.Tables[0].Rows.Count;
if (result > 0)
{
UserAvailability.InnerText = "Username taken, sorry.";
UserAvailability.Attributes.Add("class", "taken");
}
else
{
UserAvailability.InnerText = "Username available!";
UserAvailability.Attributes.Add("class", "available");
}
}
else
UserAvailability.InnerText = "Username Must be atleast 6 characters long";
}
catch (Exception ex)
{
Response.Write("There may be some problem.Please try again!!");
}
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
try
{
if (Page.IsValid)
{
con.InsertData("insert into Login_mst(User_Name,User_Pass,Email) values('" + TextBox1.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "')");
string uname = TextBox1.Text;
String thisDir = Server.MapPath("./UserData/");
System.IO.Directory.CreateDirectory(thisDir + "\\" + uname);
thisDir = Server.MapPath("./UserData/" + uname);
System.IO.Directory.CreateDirectory(thisDir + "\\Home");
thisDir = Server.MapPath("./UserData/" + uname + "/Home");
System.IO.Directory.CreateDirectory(thisDir + "\\Documents");
System.IO.Directory.CreateDirectory(thisDir + "\\Movies");
System.IO.Directory.CreateDirectory(thisDir + "\\Music");
System.IO.Directory.CreateDirectory(thisDir + "\\Pictures");
System.IO.Directory.CreateDirectory(thisDir + "\\Trash");
Response.Redirect("cloudos.aspx");
}
else
{
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
}
}
catch (Exception ex)
{
Response.Write("Your account was not successfully created.Please try again");
}
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
}
}