wangzhengquan
2020-06-08 f48e2e378bacffb96cb5575876a7b2f0081de0be
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "usg_common.h"
#include "hcnetdisk_wrapper.h"
 
int main() {
 
      hcnetdisk_init_wrapper("../hclib/");
    long userid = hcnetdisk_login_wrapper("192.168.20.11" , 8000, "admin", "a1234567");
    if (userid != -1) {
          struct tm start = {0};
        start.tm_year = 120; // 这个时间类型从1900开始算作第一年
        start.tm_mon = 3; // 0是第一个月
        start.tm_mday = 10;
        start.tm_hour = 14;
        start.tm_min = 9;
        start.tm_sec = 0;
 
          struct tm end = {0};
        end.tm_year = 120; // 这个时间类型从1900开始算作第一年
        end.tm_mon = 3; // 0是第一个月
        end.tm_mday = 10;
        end.tm_hour = 15;
        end.tm_min = 9;
        end.tm_sec = 0;
 
          // struct tm start = {.tm_mday=1};
          // struct tm end = {.tm_mday=1};
 
        if (hcnetdisk_downloadByTime_wrapper(userid, 33, &start, &end, "/home/basic/Downloads/test/123.mp3") != 0) {
            printf("下载失败\n");
        }
 
        hcnetdisk_logout_wrapper(userid);
    }
 
}