2011-01-11 60 views
0

目前我給硬編碼保存文件的路徑,但需要打開對話框,要求用戶的位置來保存驅動器上的文件。保存對話框應在本地下載/保存文件時彈出

我的客戶代碼是:

// Service1Client客戶=新Service1Client();

  client.Open(); 

      string s = client.GetData(5); 

      stream1 = client.GetFileStream("20101102.zip"); 

string filePath = @「c:\ Test \」;

  outstream = File.Open(filePath, FileMode.Create, FileAccess.Write); 

      //CopyStream(stream1, outstream); 

      const int bufferLen = 10000000; 

      byte[] buffer = new byte[bufferLen]; 

      int count = 0; 

      int bytecount = 0; 

      while ((count = stream1.Read(buffer, 0, bufferLen)) > 0) 

      { 

       outstream.Write(buffer, 0, count); 

       bytecount += count; 

      } 

     } 

請幫助我如何通過一些示例代碼實現此功能。

在此先感謝

回答

0

什麼是客戶端? WinForms中的SaveFileDialog存在什麼問題或者其他類型的應用程序中存在類似問題?