Esempio n. 1
0
 private void GetDownLoadThread()
 {
     if (ResourceGridView.SelectedRows.Count != 0)
     {
         string   requierFilename = ResourceGridView.CurrentRow.Cells[0].Value.ToString();
         string   requireUser     = ResourceGridView.CurrentRow.Cells[2].Value.ToString();
         PostData Require         = new PostData();
         Require.InData = "action=download" +
                          "&&username="******"&&password="******"&&requireuser="******"&&filename=" + requierFilename;
         string   response = Require.postPackge();
         string[] tmp      = response.Split('&');
         GetFile  getFile  = new GetFile();
         getFile.IpAddress = tmp[0];
         getFile.Port      = tmp[1];
         getFile.FileName  = tmp[2];
         getFile.FilePath  = tmp[3];
         byte[] outputb = Convert.FromBase64String(getFile.FilePath);
         getFile.FilePath = Encoding.Default.GetString(outputb);
         MessageBox.Show(getFile.FilePath);
         if (getFile.DownloadFile())
         {
             MessageBox.Show(requierFilename + "已经下载完成!");
         }
         else
         {
             MessageBox.Show(requierFilename + "下载失败!");
         }
     }
 }
Esempio n. 2
0
 private void GetDownLoadThread()
 {
     if (ResourceGridView.SelectedRows.Count != 0)
     {
         string requierFilename = ResourceGridView.CurrentRow.Cells[0].Value.ToString();
         string requireUser = ResourceGridView.CurrentRow.Cells[2].Value.ToString();
         PostData Require = new PostData();
         Require.InData = "action=download" +
                         "&&username="******"&&password="******"&&requireuser="******"&&filename=" + requierFilename;
         string response = Require.postPackge();
         string[] tmp = response.Split('&');
         GetFile getFile = new GetFile();
         getFile.IpAddress = tmp[0];
         getFile.Port = tmp[1];
         getFile.FileName = tmp[2];
         getFile.FilePath = tmp[3];
         byte[] outputb = Convert.FromBase64String(getFile.FilePath);
         getFile.FilePath = Encoding.Default.GetString(outputb);
         MessageBox.Show(getFile.FilePath);
         if (getFile.DownloadFile())
         {
             MessageBox.Show(requierFilename + "已经下载完成!");
         }
         else
         {
             MessageBox.Show(requierFilename + "下载失败!");
         }
     }
 }