Ejemplo n.º 1
0
        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>");
            }
        }
Ejemplo n.º 2
0
        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>");
            }
        }
Ejemplo n.º 3
0
        public UploadResult CallUpload(UploadRequest req)
        {
            object[] results = this.Invoke("CallUpload", new object[] {
                req
            });

            return((UploadResult)(results[0]));
        }
Ejemplo n.º 4
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);
 }
Ejemplo n.º 5
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);
 }
Ejemplo n.º 6
0
 /// <remarks/>
 public void CallUploadAsync(UploadRequest req) {
     this.CallUploadAsync(req, null);
 }
Ejemplo n.º 7
0
 public UploadResult CallUpload(UploadRequest req) {
     object[] results = this.Invoke("CallUpload", new object[] {
                 req});
     return ((UploadResult)(results[0]));
 }
Ejemplo n.º 8
0
 /// <remarks/>
 public void CallUploadAsync(UploadRequest req)
 {
     this.CallUploadAsync(req, null);
 }