title: openfiledialog results in file is being used by another process
body: <p>I would like use C# to upload multiple files to google drive</p>
  
  <p>this is my upload button function</p>
  
  <pre><code>private  void bt_upload_Click(object sender, EventArgs e)
      {
          Filedialog_init();
  
  
          DialogResult check_upload = MessageBox.Show("Want to upload these files ?", "Upload", MessageBoxButtons.OKCancel);
  
          if (check_upload == DialogResult.OK)
          {
              for (int i = 0; i &lt; result.Count; i++)
              {
                  UploadFilesDrive(service, result[i], filePath[i], Datatype[i]);
                  tx_state.AppendText(result[i] + "Upload Done");
              }
          }
      }
  </code></pre>
  
  <p>This is my Filedialog_init function</p>
  
  <pre><code>private static void Filedialog_init()
      {
          Stream myStream = null;
          OpenFileDialog openFileDialog = new OpenFileDialog();
  
          openFileDialog.InitialDirectory = "c:\\";
          openFileDialog.Filter = "bin files (*.bin)|*.bin|All files (*.*)|*.*";
          openFileDialog.FilterIndex = 1;
          openFileDialog.RestoreDirectory = true;
          openFileDialog.Multiselect = false;
  
          if (openFileDialog.ShowDialog() == DialogResult.OK)
          {
              string filename = null;
              string _datatype = null;
              try
              {
                  if ((myStream = openFileDialog.OpenFile()) != null)
                  {
                      foreach (String file in openFileDialog.FileNames)
                      {
                          filename = Path.GetFileName(file);
                          result.Add(filename);
                          // only show the name of file
  
                          Datatype.Add(_datatype);
                      }
                      filePath = openFileDialog.FileNames;
                      Datatype.ForEach(Console.WriteLine);
                  }
  
                  openFileDialog.Dispose();
  
  
              }
              catch (Exception ex)
              {
                  MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message);
              }
          }
          else
              MessageBox.Show("Upload Cancel");
      }
  </code></pre>
  
  <p>I can upload the file successfully by assigning the filename and its datatype and path directly  </p>
  
  <p>But when I used openfiledialog,it went wrong with "my file is being used by another process"</p>
  
  <p>How can I solve this problem?</p>