コード例 #1
0
ファイル: UpYunLibrary.cs プロジェクト: JerryXia/ML
 /**
 * 读取目录列表
 * @param $path 目录路径
 * return array 数组 或 null
 */
 public ArrayList readDir(string url)
 {
     Hashtable headers = new Hashtable();
     byte[] a = null;
     HttpWebResponse resp = newWorker("GET", DL + this.bucketname + url, a, headers);
     StreamReader sr = new StreamReader(resp.GetResponseStream(), Encoding.UTF8);
     string strhtml = sr.ReadToEnd();
     resp.Close();
     strhtml = strhtml.Replace("\t", "\\");
     strhtml = strhtml.Replace("\n", "\\");
     string[] ss = strhtml.Split('\\');
     int i = 0;
     ArrayList AL = new ArrayList();
     while (i < ss.Length)
     {
         FolderItem fi = new FolderItem(ss[i], ss[i + 1], int.Parse(ss[i + 2]), int.Parse(ss[i + 3]));
         AL.Add(fi);
         i += 4;
     }
     return AL;
 }
コード例 #2
0
ファイル: UpYunLibrary.cs プロジェクト: JerryXia/ML
 /// <summary>
 /// 读取目录
 /// </summary>
 /// <param name="url"></param>
 /// <returns></returns>
 public FolderItem[] readDir(string url)
 {
     ArrayList strs = upyun.readDir(url);
     FolderItem[] folders = new FolderItem[strs.Count];
     for (int i = 0; i < strs.Count; i++)
     {
         folders[i] = (FolderItem)strs[i];
     }
     return folders;
 }