示例#1
0
 public Request(RequestModel request, string ip, string port, RichTextBox textBox)
 {
     this.RequestModel = request;
     this.SendIp = ip;
     this.SendPort = port;
     this.RichTextBox = textBox;
 }
 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;
 }