public NewsServices() { servers = new BasicServices(); client = servers.PlatformClient; publicWS = new Saas.Tools.PublicInterfaceWS.PublicServiceClient(); fileClient = new Saas.Tools.NewFileUploadWS.UploadServiceClient(); RegisterServices(); }
//窗体加载 void FileUploadControl_Loaded(object sender, RoutedEventArgs e) { //fileList.ItemsSource = _files; _client = new SMT.Saas.Tools.NewFileUploadWS.UploadServiceClient(); _client.GetCompanyFileSetInfoCompleted += new EventHandler <SMT.Saas.Tools.NewFileUploadWS.GetCompanyFileSetInfoCompletedEventArgs>(_client_GetCompanyFileSetInfoCompleted); _client.DeleteFileCompleted += new EventHandler <SMT.Saas.Tools.NewFileUploadWS.DeleteFileCompletedEventArgs>(_client_DeleteFileCompleted); GetCompanyFileSetInfo(CompanyCode);//获取公司对上传文件的设置信息 }
public FileUploadRowControl() { imageSet = false; InitializeComponent(); _client = new SMT.Saas.Tools.NewFileUploadWS.UploadServiceClient(); _client.DeleteFileCompleted += new EventHandler<SMT.Saas.Tools.NewFileUploadWS.DeleteFileCompletedEventArgs>(_client_DeleteFileCompleted); removeButton.Click += new RoutedEventHandler(removeButton_Click); Loaded += new RoutedEventHandler(FileUploadRowControl_Loaded); }
public FileUploadRowControl() { imageSet = false; InitializeComponent(); _client = new SMT.Saas.Tools.NewFileUploadWS.UploadServiceClient(); _client.DeleteFileCompleted += new EventHandler <SMT.Saas.Tools.NewFileUploadWS.DeleteFileCompletedEventArgs>(_client_DeleteFileCompleted); removeButton.Click += new RoutedEventHandler(removeButton_Click); Loaded += new RoutedEventHandler(FileUploadRowControl_Loaded); }
/// <summary> /// 取消上传 /// </summary> public void CancelUpload() { try { _client = null; //_client.ChannelFactory.Close(); } catch (Exception ex) { string sr = ex.Message; } //_client.CancelUploadAsync(_file.FileName); }
public WcfFileUploader(UserFile file) { #region 传送到服务器的实体 model = new SMT.Saas.Tools.NewFileUploadWS.UserFile(); model.SmtFileListId = file.SmtFileListId;// this.SmtFileListId;//主键ID model.FileName = file.CustomFileName;//文件名 model.FileType = file.FileType;//文件类型(.doc、.xls、.txt、.pdf......) model.FileUrl = file.FileUrl;//文件地址 model.FileSize = file.FileSize; model.CompanyCode = file.CompanyCode;//公司代号 model.CompanyName = file.CompanyName;//公司名字 model.SystemCode = file.SystemCode;//系统代号 model.ModelCode = file.ModelCode;//模块代号 model.ApplicationID = file.ApplicationID;//业务ID model.ThumbnailUrl = file.ThumbnailUrl;//缩略图地址 model.INDEXL = file.Indexl;//排序 model.Remark = file.Remark;//备注 model.CreateTime = file.CreateTime;//创建时间 model.CreateName = file.CreateName;//创建人 model.UpdateTime = file.UpdateTime;//修改时间 model.UpdateName = file.UpdateName;//修改人 model.SavePath = file.SavePath;//文件保存的目录 //model.OWNERCOMPANYID = file.ow #endregion _file = file; UserID = file.UserID; _dataLength = _file.FileStream.Length; _dataSent = 0;//已经上传的大小,如果是续传,这里要得到上传文的已经上的大小 SystemCode = file.SystemCode; ModelCode = file.ModelCode; Md5Name = file.MD5String; ID = file.ID; TempID = file.TempID; _client = new SMT.Saas.Tools.NewFileUploadWS.UploadServiceClient(); _client.SaveUpLoadFileCompleted += new EventHandler<SMT.Saas.Tools.NewFileUploadWS.SaveUpLoadFileCompletedEventArgs>(_client_SaveUpLoadFileCompleted); //新加 // _client.SaveUpLoadFileCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(_client_SaveUpLoadFileCompleted);//原来 _client.CancelUploadCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(_client_CancelUploadCompleted); _client.CheckFileExistsCompleted += new EventHandler<SMT.Saas.Tools.NewFileUploadWS.CheckFileExistsCompletedEventArgs>(_client_CheckFileExistsCompleted); _client.ChannelFactory.Closed += new EventHandler(ChannelFactory_Closed); _client.GetCompanyFileSetInfoCompleted += new EventHandler<SMT.Saas.Tools.NewFileUploadWS.GetCompanyFileSetInfoCompletedEventArgs>(_client_GetCompanyFileSetInfoCompleted); _client.DeleteFileCompleted += new EventHandler<SMT.Saas.Tools.NewFileUploadWS.DeleteFileCompletedEventArgs>(_client_DeleteFileCompleted); _client.SaveUpLoadFileIsExistCompleted += new EventHandler<SMT.Saas.Tools.NewFileUploadWS.SaveUpLoadFileIsExistCompletedEventArgs>(_client_SaveUpLoadFileIsExistCompleted); }
public WcfFileUploader(UserFile file) { #region 送到服务器的实体 model = new SMT.Saas.Tools.NewFileUploadWS.UserFile(); model.SmtFileListId = file.SmtFileListId; // this.SmtFileListId;//主键ID model.FileName = file.CustomFileName; //文件名 model.FileType = file.FileType; //文件类型(.doc、.xls、.txt、.pdf......) model.FileUrl = file.FileUrl; //文件地址 model.FileSize = file.FileSize; model.CompanyCode = file.CompanyCode; //公司代号 model.CompanyName = file.CompanyName; //公司名字 model.SystemCode = file.SystemCode; //系统代号 model.ModelCode = file.ModelCode; //模块代号 model.ApplicationID = file.ApplicationID; //业务ID model.ThumbnailUrl = file.ThumbnailUrl; //缩略图地址 model.INDEXL = file.Indexl; //排序 model.Remark = file.Remark; //备注 model.CreateTime = file.CreateTime; //创建时间 model.CreateName = file.CreateName; //创建人 model.UpdateTime = file.UpdateTime; //修改时间 model.UpdateName = file.UpdateName; //修改人 model.SavePath = file.SavePath; //文件保存的目录 //model.OWNERCOMPANYID = file.ow #endregion _file = file; UserID = file.UserID; _dataLength = _file.FileStream.Length; _dataSent = 0;//已经上传的大小,如果是续传,这里要得到上传文的已经上的大小 SystemCode = file.SystemCode; ModelCode = file.ModelCode; Md5Name = file.MD5String; ID = file.ID; TempID = file.TempID; _client = new SMT.Saas.Tools.NewFileUploadWS.UploadServiceClient(); _client.SaveUpLoadFileCompleted += new EventHandler <SMT.Saas.Tools.NewFileUploadWS.SaveUpLoadFileCompletedEventArgs>(_client_SaveUpLoadFileCompleted); //新加 // _client.SaveUpLoadFileCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(_client_SaveUpLoadFileCompleted);//原来 _client.CancelUploadCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(_client_CancelUploadCompleted); _client.CheckFileExistsCompleted += new EventHandler <SMT.Saas.Tools.NewFileUploadWS.CheckFileExistsCompletedEventArgs>(_client_CheckFileExistsCompleted); _client.ChannelFactory.Closed += new EventHandler(ChannelFactory_Closed); _client.GetCompanyFileSetInfoCompleted += new EventHandler <SMT.Saas.Tools.NewFileUploadWS.GetCompanyFileSetInfoCompletedEventArgs>(_client_GetCompanyFileSetInfoCompleted); _client.DeleteFileCompleted += new EventHandler <SMT.Saas.Tools.NewFileUploadWS.DeleteFileCompletedEventArgs>(_client_DeleteFileCompleted); _client.SaveUpLoadFileIsExistCompleted += new EventHandler <SMT.Saas.Tools.NewFileUploadWS.SaveUpLoadFileIsExistCompletedEventArgs>(_client_SaveUpLoadFileIsExistCompleted); }
//窗体加载 void FileUploadControl_Loaded(object sender, RoutedEventArgs e) { //fileList.ItemsSource = _files; _client = new SMT.Saas.Tools.NewFileUploadWS.UploadServiceClient(); _client.GetCompanyFileSetInfoCompleted += new EventHandler<SMT.Saas.Tools.NewFileUploadWS.GetCompanyFileSetInfoCompletedEventArgs>(_client_GetCompanyFileSetInfoCompleted); _client.DeleteFileCompleted += new EventHandler<SMT.Saas.Tools.NewFileUploadWS.DeleteFileCompletedEventArgs>(_client_DeleteFileCompleted); GetCompanyFileSetInfo(CompanyCode);//获取公司对上传文件的设置信息 }