从远程计算机捕获上传的文件并将其传递给Web服务 [英] to capture uploaded file from remote machine and pass it to web service

查看:63
本文介绍了从远程计算机捕获上传的文件并将其传递给Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友

我想从远程计算机捕获上传的文件并将其传递给Web服务,但是无法找到任何可行的解决方案,想要在c#和asp.net中使用代码
请帮助

hi friends

I want to capture uploaded file from remote machine and pass it to web service,but was not able to find any feasible solution,want a code in c# and asp.net
please help

推荐答案



您可以使流对象成为对象并通过Web服务,但要确保它必须可序列化.
Hi,

you can make an object of stream and pass through the webservice but make sure it must be serializable.


您想要执行类似的操作,并可能将文件转换为字节数组. br/>

You want to do something like this and likely convert the file to an array of bytes.


 using (BinaryReader b = new BinaryReader(File.Open("TextFile1.txt", FileMode.Open)))
 {

        byte[] bytes =  new byte[b.BaseStream.Length];
        b.Read(bytes, 0,bytes.Length);




}


这篇关于从远程计算机捕获上传的文件并将其传递给Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆