Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using TopJobAgencyApp.Class;
- namespace TopJobAgencyApp
- {
- public partial class Register : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- protected void btnLogin_Click(object sender, EventArgs e)
- {
- Response.Redirect("Login.aspx?");
- }
- protected void btnRegister_Click1(object sender, EventArgs e)
- {
- string user = tbxDisplayname.Text;
- string email = tbxEmailaddress.Text;
- string pw = tbxPw.Text;
- string querystring = "username=" + user;
- querystring += "&" + "email=" + email;
- querystring += "&" + "password=" + pw;
- Registration u = new Registration(tbxDisplayname.Text, tbxEmailaddress.Text, tbxPw.Text);
- DBManager.InsertLogin(u);
- Response.Redirect("Login.aspx?");
- }
- protected void btnBack_Click(object sender, EventArgs e)
- {
- Response.Redirect("Home.aspx?");
- }
- public string Sanitize(string stringValue)
- {
- if (null == stringValue)
- {
- return stringValue;
- }
- else
- {
- RegexReplace(stringValue, "-{2,}", "_");
- RegexReplace(stringValue, @"(;|s)(exec|execute|select|insert|update|delete|create|alter|drop|rename|truncate|backup|restore)s", string.Empty, RegexOptions.IgnoreCase);
- RegexReplace(stringValue, "_", string.Empty);
- RegexReplace(stringValue, @"[*/]+", string.Empty);
- }
- }
- private string RegexReplace(string stringValue, string matchPattern, string toReplaceWith)
- {
- //this part are not working
- return Regex.Replace(stringValue, matchPattern, toReplaceWith);
- }
- private string RegexReplace(string stringValue, string matchPattern, string toReplaceWith, RegexOptions regexOptions)
- {
- //this part are not working
- return Regex.Replace(stringValue, matchPattern, regexOptions);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement