Advertisement
Guest User

Untitled

a guest
Feb 27th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using TopJobAgencyApp.Class;
  8. namespace TopJobAgencyApp
  9. {
  10. public partial class Register : System.Web.UI.Page
  11. {
  12. protected void Page_Load(object sender, EventArgs e)
  13. {
  14.  
  15. }
  16.  
  17. protected void btnLogin_Click(object sender, EventArgs e)
  18. {
  19. Response.Redirect("Login.aspx?");
  20. }
  21.  
  22. protected void btnRegister_Click1(object sender, EventArgs e)
  23. {
  24.  
  25. string user = tbxDisplayname.Text;
  26. string email = tbxEmailaddress.Text;
  27. string pw = tbxPw.Text;
  28.  
  29. string querystring = "username=" + user;
  30. querystring += "&" + "email=" + email;
  31. querystring += "&" + "password=" + pw;
  32.  
  33. Registration u = new Registration(tbxDisplayname.Text, tbxEmailaddress.Text, tbxPw.Text);
  34. DBManager.InsertLogin(u);
  35.  
  36. Response.Redirect("Login.aspx?");
  37. }
  38.  
  39. protected void btnBack_Click(object sender, EventArgs e)
  40. {
  41. Response.Redirect("Home.aspx?");
  42. }
  43.  
  44. public string Sanitize(string stringValue)
  45. {
  46. if (null == stringValue)
  47. {
  48. return stringValue;
  49. }
  50. else
  51. {
  52. RegexReplace(stringValue, "-{2,}", "_");
  53. RegexReplace(stringValue, @"(;|s)(exec|execute|select|insert|update|delete|create|alter|drop|rename|truncate|backup|restore)s", string.Empty, RegexOptions.IgnoreCase);
  54. RegexReplace(stringValue, "_", string.Empty);
  55. RegexReplace(stringValue, @"[*/]+", string.Empty);
  56. }
  57. }
  58. private string RegexReplace(string stringValue, string matchPattern, string toReplaceWith)
  59. {
  60. //this part are not working
  61.  
  62. return Regex.Replace(stringValue, matchPattern, toReplaceWith);
  63. }
  64. private string RegexReplace(string stringValue, string matchPattern, string toReplaceWith, RegexOptions regexOptions)
  65. {
  66. //this part are not working
  67. return Regex.Replace(stringValue, matchPattern, regexOptions);
  68. }
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement