WNetOpenEnum 在根级别之后不返回任何内容 [英] WNetOpenEnum does not return anything after root level

查看:48
本文介绍了WNetOpenEnum 在根级别之后不返回任何内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 C# 代码,它使用 WNetOpenEnum & 枚举网络邻域.WNet枚举资源.这确实返回Microsoft 终端服务"、Microsoft Windows 网络".和Web 客户端网络",但不返回 Windows 10 中 Microsoft Windows 网络级别的任何内容.

I have a C# code which enumerates through network neighborhood using WNetOpenEnum & WNetEnumResource. This does return "Microsoft Terminal Services", "Microsoft Windows Network" and "Web Client Network", but does not return anything for the Microsoft Windows Network level in Windows 10.

不过,我可以在 Windows 资源管理器中看到连接的共享.这个问题也描述了问题,但没有太多答案 - https://social.msdn.microsoft.com/Forums/en-US/6b2120f6-523e-4705-9231-fd19f05611eb/wnetopenenum-wont-enumerate-past-the-root-level-error-1231?forum=windowssdk

I can see connected shares in my Windows Explorer though. Problem is also described in this question, but there are no much answers - https://social.msdn.microsoft.com/Forums/en-US/6b2120f6-523e-4705-9231-fd19f05611eb/wnetopenenum-wont-enumerate-past-the-root-level-error-1231?forum=windowssdk

看起来 WNetOpenEnum 在 Windows 10 中不能正常工作了.我怎样才能更换它?Windows 资源管理器使用什么来显示网络共享?

Looks like WNetOpenEnum does not work properly in Windows 10 anymore. How can I replace it? What Windows Explorer uses to show Network shares?

我读过 NetUseEnum 函数,但在 MSDN 中有关于它的评论

I read about NetUseEnum function, but there is a remark about it in MSDN

此功能仅适用于服务器消息块(LAN Manager工作站)客户端.NetUseEnum 函数不支持分布式文件系统 (DFS) 共享.使用 a 枚举共享不同的网络提供商(例如 WebDAV 或 DFS 共享),使用WNetOpenEnum、WNetEnumResource 和 WNetCloseEnum 函数.

This function applies only to the Server Message Block (LAN Manager Workstation) client. The NetUseEnum function does not support Distributed File System (DFS) shares. To enumerate shares using a different network provider (WebDAV or a DFS share, for example), use the WNetOpenEnum, WNetEnumResource, and WNetCloseEnum functions.

推荐答案

我在我的 Win10 笔记本电脑上遇到了同样的问题.安装 Windows 更新(KB4586781、KB4580419、KB4586864、KB4577266)后出现问题.

I am having the same problem on my Win10 laptop. The problem occurred after installing Windows updates (KB4586781, KB4580419, KB4586864, KB4577266).

我找到了以下解决方案:您应该初始化 SMBv1 协议.有关更多详细信息,请参阅 https://social.technet.microsoft.com/Forums/en-US/6f102ed1-8e76-4cb7-8dec-05714466d441/net-view-system-error-1231?forum=win10itpronetworking

I found the following solution: You should initialize the SMBv1 protocol. For more details see https://social.technet.microsoft.com/Forums/en-US/6f102ed1-8e76-4cb7-8dec-05714466d441/net-view-system-error-1231?forum=win10itpronetworking

这篇关于WNetOpenEnum 在根级别之后不返回任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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