PageRenderTime 46ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/WCFFrameWork/WHU.GMS.Service/Interface/UserNamePassValidator.cs

https://github.com/double0291/MyGMSServer
C# | 32 lines | 30 code | 2 blank | 0 comment | 6 complexity | c519a580a1a70dfd1323b3d32c2d3270 MD5 | raw file
  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Linq;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.HtmlControls;
  9. using System.Web.UI.WebControls;
  10. using System.Web.UI.WebControls.WebParts;
  11. using System.Xml.Linq;
  12. using System.IdentityModel.Selectors;
  13. using System.ServiceModel;
  14. namespace WHU.GMS.Service
  15. {
  16. public class UserNamePassValidator : UserNamePasswordValidator
  17. {
  18. public override void Validate(string userName, string password)
  19. {
  20. if (userName == null || password == null)
  21. {
  22. throw new ArgumentNullException();
  23. }
  24. if (userName != "test")
  25. {
  26. throw new FaultException("Incorrect Username or Password");
  27. }
  28. }
  29. }
  30. }