首页 新闻 赞助 找找看

我分别使用.net remoting 和 ftp 传文件,发现 ftp 传文件要比.net remoting 快很多

0
悬赏园豆:5 [已解决问题] 解决于 2012-04-28 09:56

我分别使用.net remoting 和 ftp 传文件,发现 ftp 传文件要比.net remoting 快很多

是什么原因呢???

fun5的主页 fun5 | 初学一级 | 园豆:4
提问于:2012-02-20 13:31
< >
分享
最佳答案
0

协议不同不好比较,FTP用的是FTP协议,你自己要是能用.net remoting实现一套传输协议性能更好效率更高,那你可以去申请专利了。如果协议相同,那么比较的就是程序的实现细节,一般来说你用.NET写的比不过著名的FTP工具比如flash fxp。人家那种可是经过很长时间积累的。

收获园豆:5
水牛刀刀 | 大侠五级 |园豆:6350 | 2012-02-20 14:09

我用的filezilla 免费的

是这样的:我们公司的图片服务器 和 web 是分开的,这样就遇到一个问题,要把图片传送到 图片服务器,就会跨域,后来我分别使用 webservice .net remoting ,结果发现都没ftp 软件快,

不知道我用 .net 里面的 ftp 类库传输文件, 速度会有 .net remoting 快么?

fun5 | 园豆:4 (初学一级) | 2012-02-20 14:28

@foxidea: 为什么不用共享文件夹?代码里直接把文件扔过去就好了。自己用FTP什么的,多麻烦啊。

水牛刀刀 | 园豆:6350 (大侠五级) | 2012-02-20 14:47

@水牛刀刀: 共享文件夹要在一个局域网中吧?

我们的服务器没配置为局域网啊

fun5 | 园豆:4 (初学一级) | 2012-02-20 18:48
其他回答(1)
0

传文件本来就不是.NET Remoting的优势。

如果实在想用Remoting,建议参考一下这个帖子

You could however try to read the complete file, write it to a MemoryStream and call the stream's .ToArray() method to receive a byte array which contains the file's data. All this would be done at the server side and the return value of your method wouldn't be a Stream in this case but a Byte[]. On the client side you can re-create a MemoryStream from this Byte[] or just write it to a file by using a FileStream's .Write(Byte[], int,int) method.

dudu | 园豆:31075 (高人七级) | 2012-02-20 14:00
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册