Filepath := FileMgmt.ClientTempFileName('txt');
FileMode := FileMode.Create();
FileAccess := FileAccess.Write();
FileStr := FileStr.FileStream(FilePath,FileMode,FileAccess);
MemoryStream.WriteTo(FileStr);
FileStr.Close();
MemoryStream.Flush();
MemoryStream.Close();
Microsoft Dynamics NAV
A call to System.Net.ConnectStream.WriteTo failed with this message: The type of one or more arguments does not match the method's parameter type.
OK
Comments
Take a look at this link
http://www.mibuso.com/forum/viewtopic.php?f=7&t=58425&hilit=ftp
The code uses extensively streams, so you will definitely find differtn example for what you need.
I hope this helps.
Thanks.
string memString = "Memory test string !!";
// convert string to stream
byte[] buffer = Encoding.ASCII.GetBytes(memString);
MemoryStream ms = new MemoryStream(buffer);
//write to file
FileStream file = new FileStream("d:\\file.txt", FileMode.Create, FileAccess.Write);
ms.WriteTo(file);
Source....MemoryStream to File
Dov