Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在服务器上生成一个文件,我不想将其写入磁盘,而是通过 Web 服务将其返回给客户端。你有什么建议来做这件事?
Response.OutputStream.Write(...)
或者,如果您有 MemoryStream:
MemoryStream ms = ...; ms.WriteTo(Response.OutputStream);
编辑:
如果它是一个 SOAP Web 服务,那么只需从您的 asmx.cs 文件中的 Web 服务方法返回一个字节数组