public HttpRequester(string uri, string param, string method, string savePath = null, ProcessDelegate process = null, RespDelegate resp = null) { reqUri = uri; reqPara = param; reqMethod = method; rspFile = savePath; onProcess = process; onResponse = resp; storageSiz = 1024 * 1024 * 100; mprog = 0; current = 0; total = 1; m_IsDone = false; error = null; }
// HTTP DOWNLOAD 异步 static public HttpRequester Download(string url, int range, string savePath, ProcessDelegate onProcess = null, RespDelegate onResponse = null) { HttpRequester reqInfo = new HttpRequester(url, range.ToString(), "GETF", savePath, onProcess, onResponse); reqInfo.Start(); return(reqInfo); }
// HTTP通讯 异步 static public HttpRequester SendRequest(string url, string para, string method, ProcessDelegate onProcess = null, RespDelegate onResponse = null) { HttpRequester reqInfo = new HttpRequester(url, para, method.ToUpper(), null, onProcess, onResponse); reqInfo.Start(); return(reqInfo); }