- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我有这行简单的代码:
var entry = new DirectoryEntry("WinNT://DOMAIN/MachineName, Computer");
Console.WriteLine(entry.Guid);
实际上,路径是由命令行提供的。这个简单的控制台应用程序是为测试而编译的,在我的测试中我发现:
Unhandled Exception: System.IO.FileNotFoundException: The network path was not found.
at System.DirectoryServices.Interop.UnsafeNativeMethods.IAds.GetInfo() at System.DirectoryServices.DirectoryEntry.RefreshCache() at System.DirectoryServices.DirectoryEntry.FillCache(String propertyName) at System.DirectoryServices.DirectoryEntry.get_NativeGuid() at System.DirectoryServices.DirectoryEntry.get_Guid() at GetDirectoryEntryProperties.Program.Main(String[] args) in D:\GetDirectoryEntryProperties\Program.cs:line 15
有什么想法吗?
我是所有机器的管理员,但是我确实遇到了另一个由设备锁定服务引起的问题,该服务在询问时导致 UnauthorizedAccessException
,但在这种情况下我什至无法阅读 Guid机器。
事件日志没有任何用处。
卢克
最佳答案
我在不同情况下遇到了相同的错误消息。或许我找到的解决方案也能帮到您。
升级到 Windows 10 后,我的电脑在启动时出现弹出错误,看起来就像您发布的错误。它是 System.DirectoryServices.Interop.UnsafeNativeMethods.IAds.GetInfo() 中的 FileNotFoundException。
解决方案是将两个字符串从一个注册表位置复制到另一个位置。
Copy these strings: RegisteredOwner and RegisteredOrganization
From: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
To: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion
关于c# - System.DirectoryServices.Interop.UnsafeNativeMethods.IAds.GetInfo() 处的 FileNotFoundException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12113706/
我正在使用 Microsoft.Office.Interop.Outlook 提取电子邮件附件: var MAPI = new Application().GetNamespace("MAPI");
突然得到一个 System.invalidcastexception: unable to cast COM object of type 'system._object' to interface
我正在尝试在兼容的渲染目标上使用 Gdi 和 Direct 2D 来渲染位图。我使用 D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_GDI_COMPATIBLE 选项创建
完整错误: Could not load file or assembly 'Interop.Microsoft.Office.Interop.Word' or one of its dependen
我正在尝试寻找一种使用 Office.Interop.Outlook COM 对象连接到其他邮箱的方法。目前我正在执行以下操作(在添加 COM 对象之后): var app = new Microso
我有一个用 C# 编写的应用程序,该应用程序当前向 LDAP 进行身份验证。我们希望扩展功能以支持 IBM 的 Tivoli Access Manager,它由一个策略服务器和一个 LDAP 服务器(
在 Visual Studio 中将 interop.excel 引用添加到我的 C# winform 后,我无法再“编辑并继续”...... 错误提示“正在修改“方法” ' 包含嵌入式互操作类型/成
我正在尝试创建 Excel 文件的 Worksheet 数组,但找不到正确的转换。 这是代码: Excel.Application app = new Excel.Application(); Exc
我正在使用 C# Interop 从工作表中获取一些值,但出现以下错误: Non-invocable member 'Microsoft.Office.Interop.Excel.Range.End'
我在 MVC 桌面应用程序中使用 Nuget 包 System.Data.SQLite。当我尝试清理解决方案时出现错误。我收到的错误消息是:无法删除文件“...bin\Debug\x64\SQLite
序列化异常:程序集“Microsoft.Office.Interop.Excel,Version=11.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e
我正在通过命令行将 magento 2.1.8 升级到 2.3.3,当我运行 composer update 命令时它显示以下错误。 包 container-interop/container-int
我正在尝试从 C# 控制台应用程序中的 Excel 中捕获一些数据。 我得到了错误 Unable to cast COM object of type 'microsoft.Office.Intero
我收到一个错误: Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass' to inte
我刚刚下载了 MS Visual Studio 2010 解决方案并收到该错误。 Error 1 Assembly 'Microsoft.Office.Interop.Word, Version=15
我尝试为 socket.io 编写一个绑定(bind)。 我在使用函数(底部示例代码中的 next())时遇到问题,该函数要么不带参数,要么带有错误对象( Js.Exn.raiseError("ERR
在 C++/CLI 中,是否可以固定不包含元素的数组? 例如 array^ bytes = gcnew array(0); pin_ptr pin = &bytes[0]; //。您可以回退到 GCH
我目前正在从事一个项目,该项目包含几种不同的“编程”语言,每种语言都有自己的命名约定。应该始终使用相同的命名约定,还是应该在每种语言中使用不同的名称以具有原生外观(即不与框架的其余部分冲突)? 例如,
我是Clojure和Java的新手。 为了访问Clojure中的Java字段,您可以执行以下操作: Classname/staticField 就是一样的 (. Classname staticFie
我想提取word文档中的项目符号信息。我想要这样的东西:假设下面的文字在 word 文档中: 启动汽车的步骤: 开门 坐在里面 关上门 插入 key 等等 然后我想要我的文本文件如下: 启动汽车的步骤
我是一名优秀的程序员,十分优秀!