public void NewRequestDef() { RequestDef requestdef = new RequestDef(); requestdef.Create(); RequestDefes.Add(requestdef); }
private RequestDef PostData(ConfigDef Cd, RequestDef helper) { RequestDef R = new RequestDef(); R.configdef = Cd; R.Helper = helper; R.PostData(); return(R); }
public void SetLastRequestDef(RequestDef Requestdef) { RequestDefes[RequestDefes.Count - 1] = Requestdef; }
public void ExecuteRequestInstruction(Instruction line) { RequestDef RD = Controller.GetLastRequestDef(); switch (line.Type) { case OpCode.RequestManage: string[] Rs = line.Value.Split('.'); ConfigDef cd = Controller.GetConfigdef(int.Parse(Rs[0])); RequestDef helper = null; if (Rs.Length >= 3) { try { if (Rs[2] == "this") { helper = RD; } else { helper = Controller.GetRequestDef(int.Parse(Rs[2])); } } catch { } } if (Rs[1].ToLower() == "getdata") { RD = GetData(cd, helper); } else if (Rs[1].ToLower() == "postdata") { RD = PostData(cd, helper); } break; case OpCode.MemoryString: if (line.Value.ToLower().StartsWith("regex")) { Controller.AddMemodyString(ParseRegex(line.Value)); } else if (line.Value.ToLower() == "sourcepage") { Controller.AddMemodyString(RD.GetSourcePage()); } else if (line.Value.ToLower() == "cookies") { Controller.AddMemodyString(RD.GetCookies()); } else { Controller.AddMemodyString(line.Value); } break; case OpCode.Ret: string val = line.Value; if (line.Value.ToLower().StartsWith("regex")) { val = ParseRegex(line.Value); } else if (line.Value.ToLower() == "sourcepage") { val = RD.GetSourcePage(); } else if (line.Value.ToLower() == "cookies") { val = RD.GetCookies(); } line.Value = val; ParseRetModule(line); break; case OpCode.SetConfig: string[] Res = line.Value.Split(':'); ConfigDef cr = Controller.GetConfigdef(int.Parse(Res[0])); int indexd = line.Value.IndexOf(':'); Instruction doc = Instruction.ReadLine(line.Value.Substring(indexd + 1, line.Value.Length - indexd - 1)); SetConfig(doc, cr); break; default: CMD.OutPuter.AddMessage("The" + line.Type.ToString() + " Module not support on Request method"); break; } Controller.SetLastRequestDef(RD); }