コード例 #1
0
        private HassiumList downloadData(VirtualMachine vm, HassiumObject[] args)
        {
            HassiumList list = new HassiumList(new HassiumObject[0]);
            byte[] bytes = WebClient.DownloadData(args[0].ToString(vm).String);
            foreach (byte b in bytes)
                list.Add(vm, new HassiumChar((char)b));

            return list;
        }
コード例 #2
0
        private HassiumList uploadFile(VirtualMachine vm, HassiumObject[] args)
        {
            byte[] res;
            if (args.Length == 2)
                res = WebClient.UploadFile(args[0].ToString(vm).String, args[1].ToString(vm).String);
            else
                res = WebClient.UploadFile(args[0].ToString(vm).String, args[1].ToString(vm).String, args[2].ToString(vm).String);
            HassiumList list = new HassiumList(new HassiumObject[0]);
            foreach (byte b in res)
                list.Add(vm, new HassiumChar((char)b));

            return list;
        }