| | |
| | | using DevExpress.Utils.DirectXPaint; |
| | | using DevExpress.XtraEditors; |
| | | using Gs.DevApp.ToolBox; |
| | | using Gs.DevApp.ToolBox; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Configuration; |
| | | using System.Data; |
| | | using System.Drawing; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Net.Http; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | |
| | |
| | | btnUpSelect.Click += BtnUpSelect_Click; |
| | | btnUp.Click += BtnUp_Click; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string parentGuid |
| | | { |
| | | get; |
| | | set; |
| | | } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string parentGroup |
| | | { |
| | | get; |
| | | set; |
| | |
| | | |
| | | private async Task UploadFileAsync(string url, string filePath) |
| | | { |
| | | UcLoading _loading = new UcLoading(); |
| | | string _parentGuid = parentGuid; |
| | | using (var httpClient = new HttpClient()) |
| | | try |
| | |
| | | using (var fs = File.OpenRead(filePath)) |
| | | using (var streamContent = new StreamContent(fs)) |
| | | { |
| | | form.Add(streamContent, "file", _parentGuid + "~" + Path.GetFileName(filePath)); |
| | | form.Add(streamContent, "file", _parentGuid + "~" + Path.GetFileName(filePath) + "~" + parentGroup); |
| | | var response = await httpClient.PostAsync(url, form); |
| | | var responseString = |
| | | await response.Content.ReadAsStringAsync(); |
| | |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message); |
| | | |
| | | } |
| | | _loading.Close(); |
| | | |
| | | } |
| | | |
| | | #endregion |