コード例 #1
0
        private async Task DownloadRulePackage(RulePackage rulePackage)
        {
            if (rulePackage == null)
            {
                return;
            }

            var            downloadUrl    = $"http://www.arcgis.com/sharing/rest/content/items/{rulePackage.ID}/data";
            var            fileName       = Path.Combine(_rulePkgPath, $"{rulePackage.Name}");
            EsriHttpClient esriHttpClient = new EsriHttpClient();

            await esriHttpClient.GetAsFileAsync(downloadUrl, fileName);
        }
コード例 #2
0
        private async Task DownloadRulePackage(RulePackage rulePackage)
        {
            if (rulePackage == null)
            {
                return;
            }

            var path = System.IO.Path.Combine(_rulePkgPath, rulePackage.Portalitem.Name);

            if (System.IO.Path.GetExtension(path) == "")
            {
                path = System.IO.Path.ChangeExtension(path, "tmp");
            }
            //Download
            await rulePackage.Portalitem.GetItemDataAsync(path);
        }