public GetRequestHandler(RequestModel request, string ip, string port)
 {
     this.RequestModel = request;
     this.SendIp = ip;
     this.SendPort = port;
 }
Beispiel #2
0
 public static RequestModel ParseRequest(string reuquestString)
 {
     var request = new RequestModel();
     request.Name =
         HttpUtility.ParseQueryString(reuquestString.Substring(new[] { 0, reuquestString.IndexOf('?') }.Max()))
             .Get("name");
     request.Sendip = HttpUtility.ParseQueryString(reuquestString.Substring(new[] { 0, reuquestString.IndexOf('?') }.Max()))
             .Get("sendip");
     request.Sendport = HttpUtility.ParseQueryString(reuquestString.Substring(new[] { 0, reuquestString.IndexOf('?') }.Max()))
             .Get("sendport");
     request.TimeToLive =
         HttpUtility.ParseQueryString(reuquestString.Substring(new[] { 0, reuquestString.IndexOf('?') }.Max()))
             .Get("ttl");
     request.Id =
         HttpUtility.ParseQueryString(reuquestString.Substring(new[] { 0, reuquestString.IndexOf('?') }.Max()))
             .Get("id");
     request.Noask =
         HttpUtility.ParseQueryString(reuquestString.Substring(new[] { 0, reuquestString.IndexOf('?') }.Max()))
             .Get("noask")
             .Split(new char[] { '_' })
             .ToList();
     return request;
 }