将文件从 WCF 传递到 WCF
我在一台服务器上有一个 pdf 文件,我需要传递到另一台服务器上。两者都发布了 WCF。
在“服务”服务器上,我有以下代码(感谢反理智!):
Function GetPDF(ByVal fileName as String) as FileStream
Return File.OpenRead(fileName);
End Function
但我不知道如何在“接收”服务器上实际写入文件。我一直在玩 System.IO,但运气不太好。我需要类似的东西:
Sub WritePDF()
System.IO.WriteFile(MyService.GetPDF("Test.pdf"), "C:\NewPDF.pdf")
End Sub
对此的任何想法将不胜感激!
谢谢, 贾森
I have a pdf on one server I need to pass on another server. Both have WCF's published to them.
On the 'serving' server, I have the following code (thanks antisanity!):
Function GetPDF(ByVal fileName as String) as FileStream
Return File.OpenRead(fileName);
End Function
But I have no idea how to actually write the file on my 'receiving' server. I've been playing with System.IO, but I'm not having much luck. I need something like:
Sub WritePDF()
System.IO.WriteFile(MyService.GetPDF("Test.pdf"), "C:\NewPDF.pdf")
End Sub
Any ideas on this would be greatly apprecaited!
Thanks,
Jason
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信这就是您正在寻找的:
.Net 4:
.Net 2.0/3.5:
I believe this is what you're looking for:
.Net 4:
.Net 2.0/3.5: