//上传文件 private bool UploadImage3(string tt_path, string tt_filname) { bool flag = true; //string path = @"D:\ZGBY1701001\picture\阮景欣作文.jpg";//本地路径 //path = tt_path; byte[] tt_bytes = GetBytesByPath(tt_path); //获取文件byte[] string tt_uploadPath = "ZGlog"; //上传服务器文件夹路径 string fileName = "img18.jpg"; //文件名称 fileName = tt_filname; try { ServiceReference1.WebServiceSoapClient client = new ServiceReference1.WebServiceSoapClient(); if (client.UploadFile(tt_bytes, tt_uploadPath, tt_filname)) { flag = true; } else { flag = false; } } catch { flag = false; } return(flag); }
//上传文件 办公网服务 private bool UploadImage5(string tt_path, string tt_uploadpath, string tt_filname) { bool flag = true; byte[] tt_bytes = GetBytesByPath(tt_path);//获取文件byte[] try { ServiceReference1.WebServiceSoapClient client = new ServiceReference1.WebServiceSoapClient(); if (client.UploadFile(tt_bytes, tt_uploadpath, tt_filname)) { flag = true; } else { flag = false; } } catch { flag = false; } return(flag); }