Hi,
I need to send file between Client and Service.
How to do it?
For example:
I imagine that I should make public method (on the server side)
returning sometning like StreamReader object,
and on the client side I should to call this method.
Is it good way?
Thanks.
Greetings.
Michael Nemtsev - 30 Aug 2005 09:19 GMT
Hello schnitzell,
U should return array of bytes.
For example the server side code
using System.IO;
{
public byte[] Contents;
public string FilePath = @"c:\1.exe";
Stream s = File.Open(FilePath, FileMode.Open);
Contents = new byte[s.Length];
s.Read(Contents, 0, (int) s.Lenght);
s.Close();
// add support of getting file properties)
...
return Contents;
}
On the client perform vice versa operations, create File and write data from
Contents variable
s> I need to send file between Client and Service.
s> How to do it?
s> For example:
s> I imagine that I should make public method (on the server side)
s> returning sometning like StreamReader object,
s> and on the client side I should to call this method.
s> Is it good way?
s>
s> Thanks.
s> Greetings.
---
WBR,
Michael Nemtsev