Advertisement
Guest User

Untitled

a guest
Jun 25th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. SERVER ROUTE
  2. [HttpGet("server/status")]
  3.         public ServerStatus GetServerStatus([FromBody]MasterUserCredentials credentials)
  4.         {
  5.             // Check for master user
  6.             if(MasterUserCredentials.CheckCredentialsOf(credentials)) // Static class that compares the credentials provided with the correct credentials for a master user and check his role
  7.             {
  8.                 return ServerStatus.Good;
  9.             }
  10.         }
  11.  
  12. WPF APPLICATION THAT CAN USE ANYBODY
  13. // Get server status
  14. var status = WebUtilities.GetAsync<ServerStatus>("localhost:5000/server/status",
  15.                 new MasterUserCredentials { Username = "THIS SHOULD NOT BE HERE", Password = "ALSO THIS SHOULD NOT BE HERE" });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement