protected void Page_Load(object sender, EventArgs e) { string uid = Request.QueryString["uid"]; string mac = Request.QueryString["mac"]; string pathLoc = Request.QueryString["pathLoc"]; //客户端使用的是encodeURIComponent编码, string pathSvr = Request.QueryString["pathSvr"]; //客户端使用的是encodeURIComponent编码, pathLoc = HttpUtility.UrlDecode(pathLoc); //utf-8解码 pathSvr = HttpUtility.UrlDecode(pathSvr); //utf-8编码 string lengthLoc = Request.QueryString["lengthLoc"]; string lengthSvr = Request.QueryString["lengthSvr"]; string callback = Request.QueryString["callback"]; //应用于jsonp数据 System.Diagnostics.Debug.WriteLine("uid:" + uid); System.Diagnostics.Debug.WriteLine("mac:" + mac); System.Diagnostics.Debug.WriteLine("pathLoc:" + pathLoc); System.Diagnostics.Debug.WriteLine("pathSvr:" + pathSvr); System.Diagnostics.Debug.WriteLine("lengthLoc:" + lengthLoc); System.Diagnostics.Debug.WriteLine("lengthSvr:" + lengthSvr); System.Diagnostics.Debug.WriteLine("callback:" + callback); if (string.IsNullOrEmpty(uid) || string.IsNullOrEmpty(mac) || string.IsNullOrEmpty(pathLoc) || string.IsNullOrEmpty(pathSvr) || string.IsNullOrEmpty(lengthLoc) || string.IsNullOrEmpty(lengthSvr)) { Response.Write("参数为空"); Response.End(); return; } DnFileInf inf = new DnFileInf(); inf.uid = int.Parse(uid); inf.mac = mac; inf.pathLoc = pathLoc; inf.pathSvr = pathSvr; inf.lengthLoc = lengthLoc; inf.lengthSvr = lengthSvr; DnFile db = new DnFile(); db.Add(ref inf); string json = JsonConvert.SerializeObject(inf); //json = HttpUtility.UrlEncode(json); //json = json.Replace("+", "%20"); json = callback + "(" + json + ")";//返回jsonp格式数据。 Response.Write(json); }
protected void Page_Load(object sender, EventArgs e) { string uid = Request.QueryString["uid"]; string mac = Request.QueryString["mac"]; if (string.IsNullOrEmpty(uid) || string.IsNullOrEmpty(mac)) { Response.Write("参数为空"); Response.End(); return; } string json = DnFile.GetAll(int.Parse(uid), mac); json = HttpUtility.UrlEncode(json); json = json.Replace("+", "%20"); Response.Write(json); }
protected void Page_Load(object sender, EventArgs e) { string fid = Request.QueryString["fid"]; string uid = Request.QueryString["uid"]; string mac = Request.QueryString["mac"]; string cbk = Request.QueryString["callback"]; if (string.IsNullOrEmpty(uid) || string.IsNullOrEmpty(fid) || string.IsNullOrEmpty(mac)) { Response.Write(cbk + "(0)"); return; } DnFile db = new DnFile(); db.Delete(int.Parse(fid), int.Parse(uid), mac); Response.Write(cbk + "(1)"); }
protected void Page_Load(object sender, EventArgs e) { string uid = Request.QueryString["uid"]; string fdID = Request.QueryString["fdid"]; //xdb_folders.fd_id string mac = Request.QueryString["mac"]; string name = Request.QueryString["name"]; string pathLoc = Request.QueryString["pathLoc"]; //客户端使用的是encodeURIComponent编码, string cbk = Request.QueryString["callback"]; //应用于jsonp数据 if (string.IsNullOrEmpty(uid) || string.IsNullOrEmpty(mac) || string.IsNullOrEmpty(pathLoc) || string.IsNullOrEmpty(name)) { Response.Write("参数为空"); Response.End(); return; } DnFolderInf df = new DnFolderInf(); df.uid = int.Parse(uid); df.mac = mac; df.name = name; df.pathLoc = pathLoc; df.fdID = int.Parse(fdID); df.idSvr = DnFolder.Add(ref df); //添加到down_files表 df.idF = DnFile.Add(ref df); string json = JsonConvert.SerializeObject(df); json = HttpUtility.UrlEncode(json); //UrlEncode会将空格解析成+号 json = json.Replace("+", "%20"); json = cbk + "(" + json + ")";//返回jsonp格式数据。 Response.Write(json); }
protected void Page_Load(object sender, EventArgs e) { string fid = Request.QueryString["fid"]; string uid = Request.QueryString["uid"]; string mac = Request.QueryString["mac"]; string per = Request.QueryString["percent"]; string lenLoc = Request.QueryString["lenLoc"]; string cbk = Request.QueryString["callback"]; if (string.IsNullOrEmpty(uid) || string.IsNullOrEmpty(fid) || string.IsNullOrEmpty(cbk) || string.IsNullOrEmpty(lenLoc)) { Response.Write("参数为空"); Response.End(); return; } DnFile db = new DnFile(); db.UpdateLengthLoc(int.Parse(fid), int.Parse(uid), mac, lenLoc, per); Response.Write(cbk + "(1)"); }
protected void Page_Load(object sender, EventArgs e) { DnFile.Clear(); DnFolder.Clear(); }