以编程方式从 PC 提供数据的选项
我正在开发一个 .Net 应用程序,它将通过 WiFi 网络从 PC 向移动设备提供文件和其他结构化数据。
这样做的标准方法是什么?我的第一直觉是将 PC 视为 Web 服务主机,但我不希望用户为此目的托管 Web 服务器。
这就是 Bonjour 的用途吗? PC 友好程度如何,或者有任何明显的替代方案吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
brianestey 建议使用 SMB 共享,但是这些通过系统级文件系统导出代码进行处理,这些代码基本上以管理员级别权限执行。我确信微软在过去的五六年里已经竭尽全力真正提高了这一层的安全性,但放弃的特权似乎仍然有点太多。
相反,在主机上运行 Web 服务器允许您为运行 Web 服务器的任何帐户配置文件系统和系统权限,从而允许您根据 最小权限原则,并约束软件中可能存在安全缺陷的结果。
当然,如果您只是要以管理员身份运行 Web 服务器,那么这可能是一个没有实际意义的问题 - 您需要问自己,您认为谁可以更好地编写安全软件,Apache 还是 Microsoft。
brianestey recommends using SMB shares, but those are handled via system-level filesystem exporting code, which are executing with essentially administrator level privileges. I'm sure Microsoft has gone to great lengths in the last five or six years to really improve the security of this layer but it still seems a bit too much privileges to give away.
Instead, running a web server on the host allows you to configure the filesystem and system privileges for whatever account runs the web server, allowing you to confine the web server according to the Principle of Least Authority, and constrain the results of possible security flaws in the software.
Of course, if you're just going to run the web server as Administrator, then it is probably a moot point -- you need to ask yourself who you think can do a better job writing secure software, Apache or Microsoft.