void Button1_Click(object sender, EventArgs e) { object obj1 = HttpContext.Current.Items["a"]; if (FileUpload1.HasFile) { byte[] arr = FileUpload1.FileBytes; Response.Write(FileUpload1.FileName.Trim()); localhost.Upload upload = new localhost.Upload(); localhost.UploadRequest request = new localhost.UploadRequest() { FileBytes = arr, SaveVirtualPath = "/Account/" + Guid.NewGuid() + FileUpload1.FileName }; // localhost.UploadSoapHeader header = new localhost.UploadSoapHeader { //AuthKey = "niejunhua" }; upload.UploadSoapHeaderValue = header; localhost.UploadResult rs = upload.CallUpload(request); Response.Write("code=" + rs.Code + "<br>"); Response.Write("Msg=" + rs.Msg + "<br>"); } }
public UploadResult CallUpload(UploadRequest req) { object[] results = this.Invoke("CallUpload", new object[] { req }); return((UploadResult)(results[0])); }
/// <remarks/> public void CallUploadAsync(UploadRequest req, object userState) { if ((this.CallUploadOperationCompleted == null)) { this.CallUploadOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCallUploadOperationCompleted); } this.InvokeAsync("CallUpload", new object[] { req }, this.CallUploadOperationCompleted, userState); }
/// <remarks/> public void CallUploadAsync(UploadRequest req, object userState) { if ((this.CallUploadOperationCompleted == null)) { this.CallUploadOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCallUploadOperationCompleted); } this.InvokeAsync("CallUpload", new object[] { req}, this.CallUploadOperationCompleted, userState); }
/// <remarks/> public void CallUploadAsync(UploadRequest req) { this.CallUploadAsync(req, null); }
public UploadResult CallUpload(UploadRequest req) { object[] results = this.Invoke("CallUpload", new object[] { req}); return ((UploadResult)(results[0])); }