using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using Core.Mes.Client.Comm.Server; namespace Core.StlMes.Client.Lims.Data.PipeAndOutdec.数据管理.钢管实验管理 { public class UpLoadHandle { public static bool Upload(string CHECK_NO, string cpt, string path, out string filePathNew, string ReportEnd ="") { WebClient webClient = new WebClient(); List listPdf = new List(); string url = ""; // string filePathNew = ""; //报告目录 string reportNo = ""; //报告编号 url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=" + cpt + "&format=pdf&CHECK_NO=" + CHECK_NO; filePathNew = "Lims/pipe/" + path + "/" + CHECK_NO + "/"; reportNo = CHECK_NO + ReportEnd; byte[] pdf = webClient.DownloadData(url); FileBean fileBean = new FileBean(); fileBean.setFile(pdf); fileBean.setFileName(reportNo + ".pdf"); fileBean.setPathName(filePathNew); listPdf.Add(fileBean); webClient.Dispose(); return FileHelper.Upload(listPdf); } } }