如何在Windows 7中实现域名改写?

2026-04-10 02:202阅读0评论SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计269个文字,预计阅读时间需要2分钟。

如何在Windows 7中实现域名改写?

我编写了一个用于运行Excel加载项的DLL(几年前)。我使用该代码搜索域名,并在Windows XP中正常工作。但在Windows 7中失败。只有以管理员身份运行时才有效。但我不想以管理员身份运行,因为这是这段代码。

我写了一个运行Excel加载项的dll(几年前).

我使用此代码检索域名,并在Windows XP中正常工作,但在Windows 7中失败.
只有我以管理员身份运行才有效.
但是,我不想以管理员身份运行,因为此代码是Excel加载项DLL的一部分,如果以管理员身份运行,Excel无法找到用户的文件.

MyReg:= TRegistry.Create; MyReg.RootKey:= HKEY_LOCAL_MACHINE; MyReg.OpenKey(RegKeyWin7,false); NetworkID2:= lowercase(trim(MyReg.ReadString(RegValWin7))); MyReg.CloseKey; FreeAndNil(MyReg); FNetworkOK:= (NetworkID2 = OKRes4); //Temp check to pinpoint the problem. if FNetWorkOK = false then ShowMessage('Error wrong domain: '+NetworkID2) else ShowMessage('all ok');

如何在正常权限下使用Delphi检索Windows 7中的域名?

如何在Windows 7中实现域名改写?

在Win32 API中使用 NetWkstaGetInfo,通过级别值= 100请求信息.

Return information about the workstation environment, including platform-specific information, the name of the domain and the local computer, and information concerning the operating system. The bufptr parameter points to a WKSTA_INFO_100 structure.

本文共计269个文字,预计阅读时间需要2分钟。

如何在Windows 7中实现域名改写?

我编写了一个用于运行Excel加载项的DLL(几年前)。我使用该代码搜索域名,并在Windows XP中正常工作。但在Windows 7中失败。只有以管理员身份运行时才有效。但我不想以管理员身份运行,因为这是这段代码。

我写了一个运行Excel加载项的dll(几年前).

我使用此代码检索域名,并在Windows XP中正常工作,但在Windows 7中失败.
只有我以管理员身份运行才有效.
但是,我不想以管理员身份运行,因为此代码是Excel加载项DLL的一部分,如果以管理员身份运行,Excel无法找到用户的文件.

MyReg:= TRegistry.Create; MyReg.RootKey:= HKEY_LOCAL_MACHINE; MyReg.OpenKey(RegKeyWin7,false); NetworkID2:= lowercase(trim(MyReg.ReadString(RegValWin7))); MyReg.CloseKey; FreeAndNil(MyReg); FNetworkOK:= (NetworkID2 = OKRes4); //Temp check to pinpoint the problem. if FNetWorkOK = false then ShowMessage('Error wrong domain: '+NetworkID2) else ShowMessage('all ok');

如何在正常权限下使用Delphi检索Windows 7中的域名?

如何在Windows 7中实现域名改写?

在Win32 API中使用 NetWkstaGetInfo,通过级别值= 100请求信息.

Return information about the workstation environment, including platform-specific information, the name of the domain and the local computer, and information concerning the operating system. The bufptr parameter points to a WKSTA_INFO_100 structure.