开发者

Save Dialog box should be popup while downloading/saving the file locally

开发者 https://www.devze.com 2023-02-04 15:23 出处:网络
Currently i am giving hard-c开发者_JS百科oded path for saving the file, but need to openDialog box to ask user\'s to get location to save the file on drive.

Currently i am giving hard-c开发者_JS百科oded path for saving the file, but need to open Dialog box to ask user's to get location to save the file on drive.

My Client Code is:

//Service1Client client = new 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;

            }

        }

Please help me how can i achieve this functionality by some sample code.

Thanks in advance


What is the client? What is the problem with SaveFileDialog in WinForms or similar in other types of applications?

0

精彩评论

暂无评论...
验证码 换一张
取 消