Ejemplo n.º 1
0
        private bool UploadFile(string localpath,string filename,string serverpath,bool isUpdate,string updateType,ServiceInfo client)
        {
            UploadFile upload = new UploadFile();
            upload.FileName = filename;
            upload.FilePath = serverpath;

            Stream ms = new MemoryStream();
            FileStream fs = new FileStream(localpath, FileMode.Open, FileAccess.Read);
            fs.CopyTo(ms);
            ms.Position = 0;
            upload.FileStream = ms;
            var rst = client.UploadFile(upload);
            if (!rst.IsSuccess)
                MessageBox.Show(rst.Message);
            return rst.IsSuccess;
        }